Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
8a345b27
Commit
8a345b27
authored
Jan 20, 2021
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed MenuBar for Mac OS
parent
87e0a74f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
Setup.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Setup.kt
+25
-6
No files found.
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Setup.kt
View file @
8a345b27
...
@@ -2,20 +2,39 @@ package org.jetbrains.skiko
...
@@ -2,20 +2,39 @@ package org.jetbrains.skiko
import
javax.swing.UIManager
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
{
object
Setup
{
fun
init
(
globalLAF
:
Boolean
=
false
,
noEraseBackground
:
Boolean
=
true
)
{
fun
init
(
globalLAF
:
Boolean
=
false
,
noEraseBackground
:
Boolean
=
true
)
{
if
(
noEraseBackground
)
{
if
(
noEraseBackground
)
{
// we have to set this property to avoid render flickering.
// we have to set this property to avoid render flickering.
System
.
setProperty
(
"sun.awt.noerasebackground"
,
"true"
)
System
.
setProperty
(
"sun.awt.noerasebackground"
,
"true"
)
}
}
try
{
when
(
hostOs
)
{
OS
.
MacOS
->
{
System
.
setProperty
(
"apple.laf.useScreenMenuBar"
,
"true"
)
}
else
->
{
if
(
globalLAF
)
{
if
(
globalLAF
)
{
// Setup menu look and feel.
UIManager
.
setLookAndFeel
(
UIManager
.
getSystemLookAndFeelClassName
())
UIManager
.
setLookAndFeel
(
UIManager
.
getSystemLookAndFeelClassName
())
System
.
setProperty
(
"apple.laf.useScreenMenuBar"
,
"true"
)
}
}
}
catch
(
e
:
UnsupportedOperationException
)
{
}
// Not all platforms allow this.
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment