ToggleButton: styling selectedForeground did not work if foreground is also styled (issue #1017)

This commit is contained in:
Karl Tauber
2025-07-02 20:08:55 +02:00
parent abfaf86cd5
commit 286ce15146
2 changed files with 8 additions and 0 deletions

View File

@@ -381,6 +381,12 @@ public class FlatButtonUI
return ((FlatHelpButtonIcon)helpButtonIcon).applyStyleProperty( key, value );
}
// update internal values; otherwise isCustomBackground() and isCustomForeground() would return wrong results
switch( key ) {
case "background": background = (Color) value; break;
case "foreground": foreground = (Color) value; break;
}
if( "iconTextGap".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value );