Styling: fixed scaling of some styling properties (rowHeight for Table and Tree; iconTextGap for Button, CheckBox and RadioButton) (issue #682)

This commit is contained in:
Karl Tauber
2023-06-20 23:45:41 +02:00
parent e908362f0a
commit fde65b2730
5 changed files with 14 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ FlatLaf Change Log
#### Fixed bugs
- Styling: Fixed scaling of some styling properties (`rowHeight` for Table and
Tree; `iconTextGap` for Button, CheckBox and RadioButton). (issue #682)
- Fixed `IllegalComponentStateException` when invoker is not showing in
`SubMenuUsabilityHelper`. (issue #692)

View File

@@ -362,6 +362,9 @@ public class FlatButtonUI
return ((FlatHelpButtonIcon)helpButtonIcon).applyStyleProperty( key, value );
}
if( "iconTextGap".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value );
if( borderShared == null )
borderShared = new AtomicBoolean( true );
return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, b, borderShared );

View File

@@ -208,6 +208,9 @@ public class FlatRadioButtonUI
return ((FlatCheckBoxIcon)icon).applyStyleProperty( key, value );
}
if( "iconTextGap".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value );
return FlatStylingSupport.applyToAnnotatedObjectOrComponent( this, b, key, value );
}

View File

@@ -277,6 +277,9 @@ public class FlatTableUI
/** @since 2 */
protected Object applyStyleProperty( String key, Object value ) {
if( "rowHeight".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value );
return FlatStylingSupport.applyToAnnotatedObjectOrComponent( this, table, key, value );
}

View File

@@ -420,6 +420,9 @@ public class FlatTreeUI
/** @since 2 */
protected Object applyStyleProperty( String key, Object value ) {
if( "rowHeight".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value );
return FlatStylingSupport.applyToAnnotatedObjectOrComponent( this, tree, key, value );
}