Demo and Theme Editor: updated macOS related comments

This commit is contained in:
Karl Tauber
2022-05-13 13:54:10 +02:00
parent 37c375e2fa
commit 5f961618bf
4 changed files with 11 additions and 13 deletions

View File

@@ -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" );

View File

@@ -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