diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java index f97967e1..7e01a9d6 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/DemoFrame.java @@ -38,8 +38,8 @@ import com.formdev.flatlaf.FlatLightLaf; import com.formdev.flatlaf.demo.HintManager.Hint; import com.formdev.flatlaf.demo.extras.*; import com.formdev.flatlaf.demo.intellijthemes.*; -import com.formdev.flatlaf.extras.FlatDesktop; import com.formdev.flatlaf.extras.FlatAnimatedLafChange; +import com.formdev.flatlaf.extras.FlatDesktop; import com.formdev.flatlaf.extras.FlatSVGIcon; import com.formdev.flatlaf.extras.FlatUIDefaultsInspector; import com.formdev.flatlaf.extras.components.FlatButton; @@ -82,16 +82,17 @@ class DemoFrame if( tabIndex >= 0 && tabIndex < tabbedPane.getTabCount() && tabIndex != tabbedPane.getSelectedIndex() ) tabbedPane.setSelectedIndex( tabIndex ); - // hide some menu items on macOS + // macOS (see https://www.formdev.com/flatlaf/macos/) if( SystemInfo.isMacOS ) { + // hide menu items that are in macOS application menu exitMenuItem.setVisible( false ); aboutMenuItem.setVisible( false ); - // do not use HTML text on macOS + // do not use HTML text in menu items because this is not supported in macOS screen menu htmlMenuItem.setText( "some text" ); - // see https://www.formdev.com/flatlaf/macos/ if( SystemInfo.isMacFullWindowContentSupported ) { + // expand window content into window title bar and make title bar transparent getRootPane().putClientProperty( "apple.awt.fullWindowContent", true ); getRootPane().putClientProperty( "apple.awt.transparentTitleBar", true ); diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java index 1c856e03..2455e637 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/FlatLafDemo.java @@ -36,10 +36,8 @@ public class FlatLafDemo static boolean screenshotsMode = Boolean.parseBoolean( System.getProperty( "flatlaf.demo.screenshotsMode" ) ); public static void main( String[] args ) { - // macOS + // macOS (see https://www.formdev.com/flatlaf/macos/) if( SystemInfo.isMacOS ) { - // see https://www.formdev.com/flatlaf/macos/ - // enable screen menu bar // (moves menu bar from JFrame window to top of screen) System.setProperty( "apple.laf.useScreenMenuBar", "true" ); diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatLafThemeEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatLafThemeEditor.java index aca916b1..110489ea 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatLafThemeEditor.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatLafThemeEditor.java @@ -26,10 +26,8 @@ import com.formdev.flatlaf.util.SystemInfo; public class FlatLafThemeEditor { public static void main( String[] args ) { - // macOS + // macOS (see https://www.formdev.com/flatlaf/macos/) if( SystemInfo.isMacOS ) { - // see https://www.formdev.com/flatlaf/macos/ - // enable screen menu bar // (moves menu bar from JFrame window to top of screen) System.setProperty( "apple.laf.useScreenMenuBar", "true" ); diff --git a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java index 349c2f47..a7f14d1d 100644 --- a/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java +++ b/flatlaf-theme-editor/src/main/java/com/formdev/flatlaf/themeeditor/FlatThemeFileEditor.java @@ -173,13 +173,14 @@ class FlatThemeFileEditor enableDisableActions(); - // hide some menu items on macOS + // macOS (see https://www.formdev.com/flatlaf/macos/) if( SystemInfo.isMacOS ) { + // hide menu items that are in macOS application menu exitMenuItem.setVisible( false ); aboutMenuItem.setVisible( false ); - // see https://www.formdev.com/flatlaf/macos/ if( SystemInfo.isMacFullWindowContentSupported ) { + // expand window content into window title bar and make title bar transparent getRootPane().putClientProperty( "apple.awt.fullWindowContent", true ); getRootPane().putClientProperty( "apple.awt.transparentTitleBar", true ); @@ -195,7 +196,7 @@ class FlatThemeFileEditor // enable full screen mode for this window (for Java 8 - 10; not necessary for Java 11+) if( !SystemInfo.isJava_11_orLater ) - getRootPane().putClientProperty( "apple.awt.fullscreenable", false ); + getRootPane().putClientProperty( "apple.awt.fullscreenable", true ); } // integrate into macOS screen menu