Merge pull request #298 from Bios-Marcel/fix-demo-menu-item-states

Fix selected states for native window border related menu items
This commit is contained in:
Karl Tauber
2021-04-02 16:13:36 +02:00

View File

@@ -750,8 +750,19 @@ class DemoFrame
boolean supportsWindowDecorations = UIManager.getLookAndFeel()
.getSupportsWindowDecorations() || FlatNativeWindowBorder.isSupported();
windowDecorationsCheckBoxMenuItem.setEnabled( supportsWindowDecorations && !JBRCustomDecorations.isSupported() );
menuBarEmbeddedCheckBoxMenuItem.setEnabled( supportsWindowDecorations );
// If the JetBrainsRuntime is used, it forces the use of it's own custom
// window decoration, meaning we can't use our own.
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();