mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-27 03:46:17 -06:00
Merge main into system-file-chooser
This commit is contained in:
@@ -48,6 +48,9 @@ tasks {
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 )
|
||||
attributes( "Multi-Release" to "true" )
|
||||
|
||||
// allow loading FlatLaf native library in Java 24+ (see https://openjdk.org/jeps/472)
|
||||
attributes( "Enable-Native-Access" to "ALL-UNNAMED" )
|
||||
}
|
||||
|
||||
exclude( "module-info.class" )
|
||||
|
||||
@@ -272,8 +272,20 @@ class DemoFrame
|
||||
private void windowDecorationsChanged() {
|
||||
boolean windowDecorations = windowDecorationsCheckBoxMenuItem.isSelected();
|
||||
|
||||
// change window decoration of all frames and dialogs
|
||||
FlatLaf.setUseNativeWindowDecorations( windowDecorations );
|
||||
if( SystemInfo.isLinux ) {
|
||||
// enable/disable custom window decorations
|
||||
JFrame.setDefaultLookAndFeelDecorated( windowDecorations );
|
||||
JDialog.setDefaultLookAndFeelDecorated( windowDecorations );
|
||||
|
||||
// dispose frame, update decoration and re-show frame
|
||||
dispose();
|
||||
setUndecorated( windowDecorations );
|
||||
getRootPane().setWindowDecorationStyle( windowDecorations ? JRootPane.FRAME : JRootPane.NONE );
|
||||
setVisible( true );
|
||||
} else {
|
||||
// change window decoration of all frames and dialogs
|
||||
FlatLaf.setUseNativeWindowDecorations( windowDecorations );
|
||||
}
|
||||
|
||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( windowDecorations );
|
||||
unifiedTitleBarMenuItem.setEnabled( windowDecorations );
|
||||
@@ -530,7 +542,7 @@ class DemoFrame
|
||||
}
|
||||
|
||||
private boolean supportsFlatLafWindowDecorations() {
|
||||
return FlatLaf.supportsNativeWindowDecorations() || (SystemInfo.isLinux && JFrame.isDefaultLookAndFeelDecorated());
|
||||
return FlatLaf.supportsNativeWindowDecorations() || SystemInfo.isLinux;
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
@@ -1045,10 +1057,9 @@ class DemoFrame
|
||||
scrollingPopupMenu.add( "Item " + i );
|
||||
|
||||
if( supportsFlatLafWindowDecorations() ) {
|
||||
if( SystemInfo.isLinux )
|
||||
unsupported( windowDecorationsCheckBoxMenuItem );
|
||||
else
|
||||
windowDecorationsCheckBoxMenuItem.setSelected( FlatLaf.isUseNativeWindowDecorations() );
|
||||
windowDecorationsCheckBoxMenuItem.setSelected( SystemInfo.isLinux
|
||||
? JFrame.isDefaultLookAndFeelDecorated()
|
||||
: FlatLaf.isUseNativeWindowDecorations() );
|
||||
menuBarEmbeddedCheckBoxMenuItem.setSelected( UIManager.getBoolean( "TitlePane.menuBarEmbedded" ) );
|
||||
unifiedTitleBarMenuItem.setSelected( UIManager.getBoolean( "TitlePane.unifiedBackground" ) );
|
||||
showTitleBarIconMenuItem.setSelected( UIManager.getBoolean( "TitlePane.showIcon" ) );
|
||||
@@ -1092,7 +1103,7 @@ class DemoFrame
|
||||
private void unsupported( JCheckBoxMenuItem menuItem ) {
|
||||
menuItem.setEnabled( false );
|
||||
menuItem.setSelected( false );
|
||||
menuItem.setToolTipText( "Not supported on your system." );
|
||||
menuItem.setToolTipText( "Not supported on this platform." );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
|
||||
Reference in New Issue
Block a user