11package be.ugent.topl.mio.ui
22
3+ import com.formdev.flatlaf.util.SystemInfo
34import java.awt.BorderLayout
45import java.awt.Dimension
56import javax.swing.*
@@ -11,13 +12,25 @@ class BlockingWindow(parent: JFrame?, actionTitle: String = "Please wait") : JDi
1112 val p = JProgressBar ()
1213 p.isIndeterminate = true
1314 val panel = JPanel ().apply {
14- border = BorderFactory .createEmptyBorder(3 , 3 , 3 , 3 )
15+ val spacing = 10
16+ border = BorderFactory .createEmptyBorder(spacing, spacing, spacing, spacing)
1517 }
16- panel.layout = BorderLayout (3 , 3 )
18+ panel.layout = BorderLayout (10 , 10 )
1719 panel.add(p)
1820 panel.add(JLabel (actionTitle), BorderLayout .NORTH )
19- add(panel)
20- minimumSize = Dimension (200 , 65 )
21+ if (SystemInfo .isMacFullWindowContentSupported) {
22+ getRootPane().putClientProperty(" apple.awt.fullWindowContent" , true )
23+ getRootPane().putClientProperty(" apple.awt.transparentTitleBar" , true )
24+ getRootPane().putClientProperty(" apple.awt.windowTitleVisible" , false )
25+ val box = Box .createVerticalBox()
26+ box.add(Box .createVerticalStrut(25 ))
27+ box.add(panel)
28+ add(box)
29+ }
30+ else {
31+ add(panel)
32+ }
33+ minimumSize = Dimension (225 , 85 )
2134 isResizable = false
2235 isVisible = false
2336 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE )
0 commit comments