mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Demo:
- keep "Options > Window decorations" selected for JetBrains Runtime - disable "Options > Use underline menu selection" on macOS - added font size `11`
This commit is contained in:
@@ -35,6 +35,7 @@ import com.formdev.flatlaf.extras.components.FlatButton;
|
||||
import com.formdev.flatlaf.extras.components.FlatButton.ButtonType;
|
||||
import com.formdev.flatlaf.extras.FlatSVGUtils;
|
||||
import com.formdev.flatlaf.ui.JBRCustomDecorations;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import net.miginfocom.layout.ConstraintParser;
|
||||
import net.miginfocom.layout.LC;
|
||||
import net.miginfocom.layout.UnitValue;
|
||||
@@ -264,7 +265,7 @@ class DemoFrame
|
||||
// add font sizes
|
||||
fontMenu.addSeparator();
|
||||
ArrayList<String> sizes = new ArrayList<>( Arrays.asList(
|
||||
"10", "12", "14", "16", "18", "20", "24", "28" ) );
|
||||
"10", "11", "12", "14", "16", "18", "20", "24", "28" ) );
|
||||
if( !sizes.contains( currentSize ) )
|
||||
sizes.add( currentSize );
|
||||
sizes.sort( String.CASE_INSENSITIVE_ORDER );
|
||||
@@ -586,7 +587,7 @@ class DemoFrame
|
||||
optionsMenu.add(menuBarEmbeddedCheckBoxMenuItem);
|
||||
|
||||
//---- unifiedTitleBarMenuItem ----
|
||||
unifiedTitleBarMenuItem.setText("Unified Title Bar");
|
||||
unifiedTitleBarMenuItem.setText("Unified window title bar");
|
||||
unifiedTitleBarMenuItem.addActionListener(e -> unifiedTitleBar());
|
||||
optionsMenu.add(unifiedTitleBarMenuItem);
|
||||
|
||||
@@ -732,20 +733,20 @@ class DemoFrame
|
||||
copyMenuItem.addActionListener( new DefaultEditorKit.CopyAction() );
|
||||
pasteMenuItem.addActionListener( new DefaultEditorKit.PasteAction() );
|
||||
|
||||
boolean supportsWindowDecorations = FlatLaf.supportsNativeWindowDecorations();
|
||||
if( FlatLaf.supportsNativeWindowDecorations() ) {
|
||||
if( JBRCustomDecorations.isSupported() ) {
|
||||
// If the JetBrains Runtime is used, it forces the use of it's own custom
|
||||
// window decoration, which can not disabled.
|
||||
windowDecorationsCheckBoxMenuItem.setEnabled( false );
|
||||
}
|
||||
} else {
|
||||
unsupported( windowDecorationsCheckBoxMenuItem );
|
||||
unsupported( menuBarEmbeddedCheckBoxMenuItem );
|
||||
unsupported( unifiedTitleBarMenuItem );
|
||||
}
|
||||
|
||||
// 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." );
|
||||
}
|
||||
if( SystemInfo.isMacOS )
|
||||
unsupported( underlineMenuSelectionMenuItem );
|
||||
|
||||
// remove contentPanel bottom insets
|
||||
MigLayout layout = (MigLayout) contentPanel.getLayout();
|
||||
@@ -760,6 +761,12 @@ class DemoFrame
|
||||
layout.setLayoutConstraints( lc );
|
||||
}
|
||||
|
||||
private void unsupported( JCheckBoxMenuItem menuItem ) {
|
||||
menuItem.setEnabled( false );
|
||||
menuItem.setSelected( false );
|
||||
menuItem.setToolTipText( "Not supported on your system." );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JMenu fontMenu;
|
||||
private JMenu optionsMenu;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.3.1.342" Java: "15" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.3.1.342" Java: "16" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -362,7 +362,7 @@ new FormModel {
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
|
||||
name: "unifiedTitleBarMenuItem"
|
||||
"text": "Unified Title Bar"
|
||||
"text": "Unified window title bar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user