diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cc7c12d1..1b83671f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ FlatLaf Change Log - Custom window decorations: Center title if menu bar is embedded. - Custom window decorations: Cursor of components (e.g. TextField) was not changed. (issue #125) +- CheckBox: Fixed colors in light IntelliJ themes. (issue #126) - InternalFrame: Use default icon in internal frames. (issue #122) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java index 5397cc8ae..f734bb748 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -412,6 +412,10 @@ private void applyCheckBoxColors( UIDefaults defaults ) { String newKey = checkboxKeyMapping.get( key ); if( newKey != null ) { + String checkBoxIconPrefix = "CheckBox.icon."; + if( !dark && newKey.startsWith( checkBoxIconPrefix ) ) + newKey = "CheckBox.icon[filled].".concat( newKey.substring( checkBoxIconPrefix.length() ) ); + ColorUIResource color = toColor( (String) value ); if( color != null ) { defaults.put( newKey, color ); @@ -444,12 +448,23 @@ private void applyCheckBoxColors( UIDefaults defaults ) { // remove hover and pressed colors if( checkboxModified ) { + defaults.remove( "CheckBox.icon.focusWidth" ); defaults.remove( "CheckBox.icon.hoverBorderColor" ); defaults.remove( "CheckBox.icon.focusedBackground" ); defaults.remove( "CheckBox.icon.hoverBackground" ); defaults.remove( "CheckBox.icon.pressedBackground" ); + defaults.remove( "CheckBox.icon.selectedFocusedBackground" ); defaults.remove( "CheckBox.icon.selectedHoverBackground" ); defaults.remove( "CheckBox.icon.selectedPressedBackground" ); + + defaults.remove( "CheckBox.icon[filled].focusWidth" ); + defaults.remove( "CheckBox.icon[filled].hoverBorderColor" ); + defaults.remove( "CheckBox.icon[filled].focusedBackground" ); + defaults.remove( "CheckBox.icon[filled].hoverBackground" ); + defaults.remove( "CheckBox.icon[filled].pressedBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedFocusedBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedHoverBackground" ); + defaults.remove( "CheckBox.icon[filled].selectedPressedBackground" ); } // copy values diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties index d8e48e2ff..ff74319d7 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties @@ -36,7 +36,6 @@ Button.default.borderWidth=1 #---- CheckBox ---- CheckBox.icon.style=filled -CheckBox.icon[filled].focusWidth=2 #---- Component ---- diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatIntelliJLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatIntelliJLaf_1.8.0_202.txt index e3d5921fe..1943aed05 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatIntelliJLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatIntelliJLaf_1.8.0_202.txt @@ -38,8 +38,6 @@ + CheckBox.icon.style filled -+ CheckBox.icon[filled].focusWidth 2 - - CheckBox.icon[filled].selectedFocusedCheckmarkColor #e3f1fa javax.swing.plaf.ColorUIResource [UI] - ComboBox.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatRoundBorder [UI] diff --git a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt index 2e253ca0c..a4b557545 100644 --- a/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt +++ b/flatlaf-theme-editor/src/main/resources/com/formdev/flatlaf/themeeditor/FlatLafUIKeys.txt @@ -76,7 +76,6 @@ CheckBox.icon.selectedFocusedBorderColor CheckBox.icon.style CheckBox.iconTextGap CheckBox.icon[filled].checkmarkColor -CheckBox.icon[filled].focusWidth CheckBox.icon[filled].selectedBackground CheckBox.icon[filled].selectedBorderColor CheckBox.icon[filled].selectedFocusedBackground