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
f8c72057
Commit
f8c72057
authored
Oct 13, 2020
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup menu bar look and feel.
parent
c58b2ea4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
App.kt
...kijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
+0
-6
Library.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Library.kt
+9
-0
No files found.
samples/SkijaInjectSample/src/main/kotlin/SkijaInjectSample/App.kt
View file @
f8c72057
...
...
@@ -40,12 +40,6 @@ fun createWindow(title: String) {
// Create menu.
val
menuBar
=
JMenuBar
()
try
{
System
.
setProperty
(
"apple.laf.useScreenMenuBar"
,
"true"
)
java
.
awt
.
Desktop
.
getDesktop
().
setDefaultMenuBar
(
menuBar
)
}
catch
(
e
:
UnsupportedOperationException
)
{
// Not all platforms allow this.
}
val
menu
=
JMenu
(
"File"
)
menuBar
.
add
(
menu
)
val
menuItem
=
JMenuItem
(
"Say Hello"
)
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/Library.kt
View file @
f8c72057
...
...
@@ -5,6 +5,7 @@ import java.io.InputStreamReader
import
java.io.File
import
java.nio.file.Files
import
java.nio.file.StandardCopyOption
import
javax.swing.UIManager
object
Library
{
private
var
loaded
=
false
...
...
@@ -45,5 +46,13 @@ object Library {
// we have to set this property to avoid render flickering.
System
.
setProperty
(
"sun.awt.noerasebackground"
,
"true"
)
// setup menu look and feel
try
{
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