mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
macOS large title bar: added client property FlatClientProperties.MACOS_LARGE_WINDOW_TITLE_BAR (or "FlatLaf.macOS.largeWindowTitleBar")
This commit is contained in:
@@ -527,6 +527,21 @@ public interface FlatClientProperties
|
||||
*/
|
||||
String WINDOW_STYLE_SMALL = "small";
|
||||
|
||||
/**
|
||||
* Specifies whether the window should have a large title bar.
|
||||
* This adds extra space around the close/minimize/zoom buttons.
|
||||
* Useful if <a href="https://www.formdev.com/flatlaf/macos/#full_window_content">full window content</a>
|
||||
* is enabled.
|
||||
* <p>
|
||||
* (requires macOS 10.14+, Java 17+ and client property {@code apple.awt.fullWindowContent} set to {@code true})
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JRootPane}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||
*
|
||||
* @since 3.3
|
||||
*/
|
||||
String MACOS_LARGE_WINDOW_TITLE_BAR = "FlatLaf.macOS.largeWindowTitleBar";
|
||||
|
||||
|
||||
//---- JScrollBar / JScrollPane -------------------------------------------
|
||||
|
||||
|
||||
@@ -367,6 +367,21 @@ public class FlatRootPaneUI
|
||||
if( rootPane.isDisplayable() )
|
||||
throw new IllegalComponentStateException( "The client property 'Window.style' must be set before the window becomes displayable." );
|
||||
break;
|
||||
|
||||
case FlatClientProperties.MACOS_LARGE_WINDOW_TITLE_BAR:
|
||||
case "ancestor":
|
||||
if( SystemInfo.isMacFullWindowContentSupported &&
|
||||
SystemInfo.isJava_17_orLater &&
|
||||
rootPane.isDisplayable() &&
|
||||
FlatClientProperties.clientPropertyBoolean( rootPane, "apple.awt.fullWindowContent", false ) &&
|
||||
FlatNativeMacLibrary.isLoaded() )
|
||||
{
|
||||
Window window = SwingUtilities.windowForComponent( rootPane );
|
||||
boolean enabled = FlatClientProperties.clientPropertyBoolean( rootPane,
|
||||
FlatClientProperties.MACOS_LARGE_WINDOW_TITLE_BAR, false );
|
||||
FlatNativeMacLibrary.setWindowToolbar( window, enabled );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user