mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
support changing default font used for all components with automatic scaling UI if using larger font
This commit is contained in:
@@ -208,6 +208,11 @@ public class FlatTestFrame
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
UIScale.addPropertyChangeListener( e -> {
|
||||
// update title because user scale factor may change
|
||||
updateTitle();
|
||||
} );
|
||||
}
|
||||
|
||||
private void updateTitle() {
|
||||
@@ -403,7 +408,7 @@ public class FlatTestFrame
|
||||
}
|
||||
|
||||
private void updateScaleFactorComboBox() {
|
||||
scaleFactorComboBox.setEnabled( !UIScale.isSystemScalingEnabled() && UIManager.getLookAndFeel() instanceof FlatLaf );
|
||||
scaleFactorComboBox.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf );
|
||||
}
|
||||
|
||||
private void sizeVariantChanged() {
|
||||
|
||||
@@ -368,7 +368,16 @@ public class UIDefaultsDump
|
||||
|
||||
private void dumpActiveValue( PrintWriter out, ActiveValue value ) {
|
||||
out.print( "[active] " );
|
||||
dumpValue( out, value.createValue( defaults ) );
|
||||
Object realValue = value.createValue( defaults );
|
||||
|
||||
if( realValue instanceof Font && realValue == UIManager.getFont( "defaultFont" ) ) {
|
||||
// dump "$defaultFont" for the default font to make it easier to
|
||||
// compare Windows/Linux dumps with macOS dumps
|
||||
out.print( "$defaultFont" );
|
||||
if( realValue instanceof UIResource )
|
||||
out.print( " [UI]" );
|
||||
} else
|
||||
dumpValue( out, realValue );
|
||||
}
|
||||
|
||||
private String dumpClass( Object value ) {
|
||||
|
||||
Reference in New Issue
Block a user