CheckBox: fixed colors in light IntelliJ themes (issue #126)

This commit is contained in:
Karl Tauber
2020-07-10 15:35:02 +02:00
parent c232de1996
commit 82294b68eb
5 changed files with 16 additions and 4 deletions

View File

@@ -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)

View File

@@ -412,6 +412,10 @@ public class IntelliJTheme
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 @@ public class IntelliJTheme
// 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

View File

@@ -36,7 +36,6 @@ Button.default.borderWidth=1
#---- CheckBox ----
CheckBox.icon.style=filled
CheckBox.icon[filled].focusWidth=2
#---- Component ----

View File

@@ -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]

View File

@@ -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