From ef38f3805e9f0a52841dcbc767390eae9c7f42ae Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 1 Aug 2020 00:31:20 +0200 Subject: [PATCH] IntelliJ Themes: fixed text colors in ProgressBar (issue #138) --- CHANGELOG.md | 1 + .../com/formdev/flatlaf/IntelliJTheme.java | 10 +-- .../flatlaf/IntelliJTheme$ThemeLaf.properties | 69 +++++++++++++++++++ 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e29868..73acdaeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ FlatLaf Change Log modifier key order conform with macOS standard. (issue #141) - FileChooser: Fixed too small text field when renaming a file/directory in Flat IntelliJ/Darcula themes. (issue #143) +- IntelliJ Themes: Fixed text colors in ProgressBar. (issue #138) ## 0.38 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 f734bb74..df08b677 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -147,6 +147,10 @@ public class IntelliJTheme applyColorPalette( defaults ); applyCheckBoxColors( defaults ); + // copy values + for( Map.Entry e : uiKeyCopying.entrySet() ) + defaults.put( e.getKey(), defaults.get( e.getValue() ) ); + // IDEA does not paint button background if disabled, but FlatLaf does Object panelBackground = defaults.get( "Panel.background" ); defaults.put( "Button.disabledBackground", panelBackground ); @@ -466,10 +470,6 @@ public class IntelliJTheme defaults.remove( "CheckBox.icon[filled].selectedHoverBackground" ); defaults.remove( "CheckBox.icon[filled].selectedPressedBackground" ); } - - // copy values - for( Map.Entry e : uiKeyCopying.entrySet() ) - defaults.put( e.getKey(), defaults.get( e.getValue() ) ); } private static Map uiKeyMapping = new HashMap<>(); @@ -514,6 +514,8 @@ public class IntelliJTheme uiKeyMapping.put( "ProgressBar.foreground", "" ); // ignore uiKeyMapping.put( "ProgressBar.trackColor", "ProgressBar.background" ); uiKeyMapping.put( "ProgressBar.progressColor", "ProgressBar.foreground" ); + uiKeyCopying.put( "ProgressBar.selectionForeground", "ProgressBar.background" ); + uiKeyCopying.put( "ProgressBar.selectionBackground", "ProgressBar.foreground" ); // ScrollBar uiKeyMapping.put( "ScrollBar.trackColor", "ScrollBar.track" ); diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties index 002dc99a..a2abdc11 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/IntelliJTheme$ThemeLaf.properties @@ -45,9 +45,24 @@ ToggleButton.endBackground=$ToggleButton.background #---- theme specific ---- +[Arc_Theme]ProgressBar.selectionBackground=#000 +[Arc_Theme]ProgressBar.selectionForeground=#fff + +[Arc_Theme_-_Orange]ProgressBar.selectionBackground=#000 +[Arc_Theme_-_Orange]ProgressBar.selectionForeground=#fff + +[Arc_Theme_Dark]ProgressBar.selectionBackground=#ddd +[Arc_Theme_Dark]ProgressBar.selectionForeground=#ddd + +[Arc_Theme_Dark_-_Orange]ProgressBar.selectionBackground=#ddd +[Arc_Theme_Dark_-_Orange]ProgressBar.selectionForeground=#fff + [Cobalt_2]CheckBox.icon.background=#002946 [Cobalt_2]CheckBox.icon.checkmarkColor=#002946 +[Dracula]ProgressBar.selectionBackground=#fff +[Dracula]ProgressBar.selectionForeground=#fff + [Gruvbox_Dark_Hard]ToggleButton.selectedBackground=$ToggleButton.selectedBackground [Gruvbox_Dark_Hard]ToggleButton.toolbar.selectedBackground=$ToggleButton.toolbar.selectedBackground @@ -65,3 +80,57 @@ ToggleButton.endBackground=$ToggleButton.background [High_contrast]ToggleButton.selectedForeground=#000 [High_contrast]ToggleButton.disabledSelectedBackground=#444 [High_contrast]ToggleButton.toolbar.selectedBackground=#fff + + +# Material Theme UI Lite + +[Dracula_Contrast]ProgressBar.selectionBackground=#fff +[Dracula_Contrast]ProgressBar.selectionForeground=#fff + +[GitHub]ProgressBar.selectionBackground=#222 +[GitHub]ProgressBar.selectionForeground=#222 + +[GitHub_Contrast]ProgressBar.selectionBackground=#222 +[GitHub_Contrast]ProgressBar.selectionForeground=#222 + +[Light_Owl]ProgressBar.selectionBackground=#111 +[Light_Owl]ProgressBar.selectionForeground=#fff + +[Light_Owl_Contrast]ProgressBar.selectionBackground=#111 +[Light_Owl_Contrast]ProgressBar.selectionForeground=#fff + +[Material_Lighter]ProgressBar.selectionBackground=#222 +[Material_Lighter]ProgressBar.selectionForeground=#fff + +[Material_Lighter_Contrast]ProgressBar.selectionBackground=#222 +[Material_Lighter_Contrast]ProgressBar.selectionForeground=#fff + +[Material_Oceanic]ProgressBar.selectionBackground=#ddd +[Material_Oceanic]ProgressBar.selectionForeground=#ddd + +[Material_Oceanic_Contrast]ProgressBar.selectionBackground=#ddd +[Material_Oceanic_Contrast]ProgressBar.selectionForeground=#ddd + +[Material_Palenight]ProgressBar.selectionBackground=#ddd +[Material_Palenight]ProgressBar.selectionForeground=#ddd + +[Material_Palenight_Contrast]ProgressBar.selectionBackground=#ddd +[Material_Palenight_Contrast]ProgressBar.selectionForeground=#ddd + +[Night_Owl]ProgressBar.selectionBackground=#ddd +[Night_Owl]ProgressBar.selectionForeground=#ddd + +[Night_Owl_Contrast]ProgressBar.selectionBackground=#ddd +[Night_Owl_Contrast]ProgressBar.selectionForeground=#ddd + +[Solarized_Dark]ProgressBar.selectionBackground=#ccc +[Solarized_Dark]ProgressBar.selectionForeground=#ccc + +[Material_Solarized_Dark_Contrast]ProgressBar.selectionBackground=#ccc +[Material_Solarized_Dark_Contrast]ProgressBar.selectionForeground=#ccc + +[Solarized_Light]ProgressBar.selectionBackground=#222 +[Solarized_Light]ProgressBar.selectionForeground=#fff + +[Material_Solarized_Light_Contrast]ProgressBar.selectionBackground=#222 +[Material_Solarized_Light_Contrast]ProgressBar.selectionForeground=#fff