mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Fix selected states for native window border related menu items
The menu items for custom window decorations and embeded menu bar aren't selected anymore if the feature isn't supported. On top of that, there's now a tooltip indicating that these aren't supported.
This commit is contained in:
@@ -750,8 +750,16 @@ class DemoFrame
|
||||
|
||||
boolean supportsWindowDecorations = UIManager.getLookAndFeel()
|
||||
.getSupportsWindowDecorations() || FlatNativeWindowBorder.isSupported();
|
||||
windowDecorationsCheckBoxMenuItem.setEnabled( supportsWindowDecorations && !JBRCustomDecorations.isSupported() );
|
||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( supportsWindowDecorations );
|
||||
if( !supportsWindowDecorations || JBRCustomDecorations.isSupported() ) {
|
||||
windowDecorationsCheckBoxMenuItem.setEnabled( false );
|
||||
windowDecorationsCheckBoxMenuItem.setSelected( false );
|
||||
windowDecorationsCheckBoxMenuItem.setToolTipText( "Not supported on your system." );
|
||||
}
|
||||
if( !supportsWindowDecorations ) {
|
||||
menuBarEmbeddedCheckBoxMenuItem.setEnabled( false );
|
||||
menuBarEmbeddedCheckBoxMenuItem.setSelected( false );
|
||||
menuBarEmbeddedCheckBoxMenuItem.setToolTipText( "Not supported on your system." );
|
||||
}
|
||||
|
||||
// remove contentPanel bottom insets
|
||||
MigLayout layout = (MigLayout) contentPanel.getLayout();
|
||||
|
||||
Reference in New Issue
Block a user