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

@@ -4,6 +4,8 @@ FlatLaf Change Log
## 3.6.1-SNAPSHOT ## 3.6.1-SNAPSHOT
- Extras: Support JSVG 2.0.0. Minimum JSVG version is now 1.6.0. (issue #997) - Extras: Support JSVG 2.0.0. Minimum JSVG version is now 1.6.0. (issue #997)
- ToggleButton: Styling `selectedForeground` did not work if `foreground` is
also styled. (issue #1017)
- JideSplitButton: Fixed updating popup when switching theme. (issue #1000) - JideSplitButton: Fixed updating popup when switching theme. (issue #1000)
- IntelliJ Themes: Fixed logging false errors when loading 3rd party - IntelliJ Themes: Fixed logging false errors when loading 3rd party
`.theme.json` files. (issue #990) `.theme.json` files. (issue #990)

View File

@@ -381,6 +381,12 @@ public class FlatButtonUI
return ((FlatHelpButtonIcon)helpButtonIcon).applyStyleProperty( key, value ); 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 ) if( "iconTextGap".equals( key ) && value instanceof Integer )
value = UIScale.scale( (Integer) value ); value = UIScale.scale( (Integer) value );