Skip to content

Commit 1cb4151

Browse files
committed
Keep fullWindowContents in mind when setting the AboutScreen size
1 parent 7bd11f4 commit 1cb4151

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
@@ -15,8 +15,8 @@ import javax.swing.*
1515

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

47-
private fun configureTheme() {
47+
private fun configureTheme(): Boolean {
4848
if (SystemInfo.isMacFullWindowContentSupported) {
4949
rootPane.putClientProperty("apple.awt.transparentTitleBar", true)
5050
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)