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:
Marcel Schramm
2021-03-31 19:54:00 +02:00
parent d13ddeb944
commit 620aa8bcee

View File

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