Skip to content

Commit f315cbd

Browse files
committed
Improve BlockingWindow styling
1 parent 318cfe8 commit f315cbd

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/main/kotlin/be/ugent/topl/mio/ui/BlockingWindow.kt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package be.ugent.topl.mio.ui
22

3+
import com.formdev.flatlaf.util.SystemInfo
34
import java.awt.BorderLayout
45
import java.awt.Dimension
56
import 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)

src/main/kotlin/be/ugent/topl/mio/ui/InteractiveDebugger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ class MultiversePanel(private val multiverseDebugger: MultiverseDebugger, config
510510

511511
concolicButton.addActionListener {
512512
val w = BlockingWindow(null, "Analysing program")
513-
w.location = Point(this.location.x + this.width/2 - w.width/2, this.location.y + this.height/2 - w.height/2)
513+
w.setLocationRelativeTo(this)
514514
w.run({ multiverseDebugger.predictFuture(maxInstructions) }) { graphChanged ->
515515
if (!graphChanged) {
516516
JOptionPane.showMessageDialog(this, "No future branching paths could be found")

0 commit comments

Comments
 (0)