IntelliJ Themes: removed code that is obsolete since supporting gradient button background/border colors in commit de82dac8

make sure that gradient colors are predefined for improved compatibility
this fixes button background in Arc themes and toggle button background in Dark Flat and Light Flat themes
This commit is contained in:
Karl Tauber
2020-04-21 10:02:11 +02:00
parent be81cb7876
commit 262d172cde
2 changed files with 17 additions and 12 deletions

View File

@@ -270,7 +270,7 @@ public class IntelliJTheme
// (e.g. set ComboBox.buttonEditableBackground to *.background
// because it is mapped from ComboBox.ArrowButton.background)
String km = uiKeyInverseMapping.getOrDefault( k, (String) k );
if( km.endsWith( tail ) && !noWildcardReplace.contains( k ) && !((String)k).startsWith( "CheckBox.icon." ) )
if( km.endsWith( tail ) && !((String)k).startsWith( "CheckBox.icon." ) )
defaults.put( k, uiValue );
}
}
@@ -412,7 +412,6 @@ public class IntelliJTheme
private static Map<String, String> uiKeyInverseMapping = new HashMap<>();
private static Map<String, String> checkboxKeyMapping = new HashMap<>();
private static Map<String, String> checkboxDuplicateColors = new HashMap<>();
private static Set<String> noWildcardReplace = new HashSet<>();
static {
// ComboBox
@@ -470,16 +469,6 @@ public class IntelliJTheme
Map.Entry<String, String>[] entries = checkboxDuplicateColors.entrySet().toArray( new Map.Entry[checkboxDuplicateColors.size()] );
for( Map.Entry<String, String> e : entries )
checkboxDuplicateColors.put( e.getValue(), e.getKey() );
// because FlatLaf uses Button.background and Button.borderColor,
// but IDEA uses Button.startBackground and Button.startBorderColor,
// our default button background and border colors may be replaced by
// wildcard *.background and *.borderColor colors
noWildcardReplace.add( "Button.background" );
noWildcardReplace.add( "Button.borderColor" );
noWildcardReplace.add( "Button.default.background" );
noWildcardReplace.add( "Button.default.borderColor" );
noWildcardReplace.add( "ToggleButton.background" );
}
//---- class ThemeLaf -----------------------------------------------------

View File

@@ -16,6 +16,16 @@
#---- Button ----
Button.startBackground=$Button.background
Button.endBackground=$Button.background
Button.startBorderColor=$Button.borderColor
Button.endBorderColor=$Button.borderColor
Button.default.startBackground=$Button.default.background
Button.default.endBackground=$Button.default.background
Button.default.startBorderColor=$Button.default.borderColor
Button.default.endBorderColor=$Button.default.borderColor
Button.hoverBorderColor=null
Button.default.hoverBorderColor=null
@@ -23,3 +33,9 @@ Button.default.hoverBorderColor=null
#---- HelpButton ----
HelpButton.hoverBorderColor=null
#---- ToggleButton ----
ToggleButton.startBackground=$ToggleButton.background
ToggleButton.endBackground=$ToggleButton.background