From b5c13bd1b3f651061dd9e3c20d16593e6f5ec80b Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Wed, 20 Nov 2019 17:09:49 +0100 Subject: [PATCH] IntelliJ Themes: fixes for ProgressBar --- .../com/formdev/flatlaf/IntelliJTheme.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) 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 30efe1b3..cdbaa116 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -193,14 +193,10 @@ public class IntelliJTheme } else { uiKeys.add( key ); - // Darcula buttons support gradient for background and border, but FlatLaf does not - if( key.endsWith( ".startBackground" ) || key.endsWith( ".startBorderColor" ) ) - key = key.replace( ".startB", ".b" ); - else if( key.endsWith( ".endBackground" ) || key.endsWith( ".endBorderColor" ) ) - return; // ignore - // map keys key = uiKeyMapping.getOrDefault( key, key ); + if( key.isEmpty() ) + return; // ignore key String valueStr = value.toString(); @@ -350,6 +346,17 @@ public class IntelliJTheme private static Set noWildcardReplace = new HashSet<>(); static { + // Button + // Darcula buttons support gradient for background and border, but FlatLaf does not + uiKeyMapping.put( "Button.startBackground", "Button.background" ); + uiKeyMapping.put( "Button.startBorderColor", "Button.borderColor" ); + uiKeyMapping.put( "Button.default.startBackground", "Button.default.background" ); + uiKeyMapping.put( "Button.default.startBorderColor", "Button.default.borderColor" ); + uiKeyMapping.put( "Button.endBackground", "" ); // ignore + uiKeyMapping.put( "Button.endBorderColor", "" ); // ignore + uiKeyMapping.put( "Button.default.endBackground", "" ); // ignore + uiKeyMapping.put( "Button.default.endBorderColor", "" ); // ignore + // ComboBox uiKeyMapping.put( "ComboBox.background", "ComboBox.editableBackground" ); uiKeyMapping.put( "ComboBox.nonEditableBackground", "ComboBox.background" ); @@ -358,6 +365,12 @@ public class IntelliJTheme uiKeyMapping.put( "ComboBox.ArrowButton.iconColor", "ComboBox.buttonArrowColor" ); uiKeyMapping.put( "ComboBox.ArrowButton.nonEditableBackground", "ComboBox.buttonBackground" ); + // ProgressBar + uiKeyMapping.put( "ProgressBar.background", "" ); // ignore + uiKeyMapping.put( "ProgressBar.foreground", "" ); // ignore + uiKeyMapping.put( "ProgressBar.trackColor", "ProgressBar.background" ); + uiKeyMapping.put( "ProgressBar.progressColor", "ProgressBar.foreground" ); + for( Map.Entry e : uiKeyMapping.entrySet() ) uiKeyInverseMapping.put( e.getValue(), e.getKey() );