Commit 8ff83215 authored by Roman Sedaikin's avatar Roman Sedaikin

Fixed Setup.init

parent 8a345b27
......@@ -2,39 +2,22 @@ package org.jetbrains.skiko
import javax.swing.UIManager
// object Setup {
// fun init(globalLAF: Boolean = false, noEraseBackground: Boolean = true) {
// if (noEraseBackground) {
// // we have to set this property to avoid render flickering.
// System.setProperty("sun.awt.noerasebackground", "true")
// }
// try {
// if (globalLAF) {
// // Setup menu look and feel.
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
// System.setProperty("apple.laf.useScreenMenuBar", "true")
// }
// } catch (e: UnsupportedOperationException) {
// // Not all platforms allow this.
// }
// }
// }
object Setup {
fun init(globalLAF: Boolean = false, noEraseBackground: Boolean = true) {
if (noEraseBackground) {
// we have to set this property to avoid render flickering.
System.setProperty("sun.awt.noerasebackground", "true")
}
when(hostOs) {
OS.MacOS -> {
System.setProperty("apple.laf.useScreenMenuBar", "true")
}
else -> {
if (globalLAF) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
}
try {
if (globalLAF) {
// Setup menu look and feel.
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
}
} catch (e: UnsupportedOperationException) {
// Not all platforms allow this.
}
if (hostOs == OS.MacOS) {
System.setProperty("apple.laf.useScreenMenuBar", "true")
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment