Skip to content

Commit c10988a

Browse files
committed
Keep fullWindowContents in mind when setting the AboutScreen size
1 parent 61e42f3 commit c10988a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import javax.swing.*
1616

1717
open class AboutScreen(protected val config: DebuggerConfig) : JFrame() {
1818
init {
19-
configureTheme()
20-
setSize(450, 350)
19+
val fullWindowContents = configureTheme()
20+
setSize(450, 350 + if (!fullWindowContents) 20 else 0)
2121
minimumSize = Dimension(450, 350)
2222
val mainPanel = JPanel()
2323
mainPanel.setLayout(BoxLayout(mainPanel, BoxLayout.Y_AXIS))
@@ -45,7 +45,7 @@ open class AboutScreen(protected val config: DebuggerConfig) : JFrame() {
4545
})
4646
}
4747

48-
private fun configureTheme() {
48+
private fun configureTheme(): Boolean {
4949
if (SystemInfo.isMacFullWindowContentSupported) {
5050
rootPane.putClientProperty("apple.awt.transparentTitleBar", true)
5151
rootPane.putClientProperty("apple.awt.fullWindowContent", true)
@@ -72,5 +72,6 @@ open class AboutScreen(protected val config: DebuggerConfig) : JFrame() {
7272
}
7373
else FlatDarkLaf.setup()
7474
}
75+
return SystemInfo.isMacFullWindowContentSupported
7576
}
7677
}

0 commit comments

Comments
 (0)