From f2dad88875d0a642d904a7b28b6716749deb9df4 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Fri, 10 Jan 2020 00:13:39 +0100 Subject: [PATCH] ToggleButton: support underline toggle button colors in IntelliJ themes --- .../main/java/com/formdev/flatlaf/IntelliJTheme.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 468bf58d..7c556807 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -401,9 +401,14 @@ public class IntelliJTheme defaults.remove( "CheckBox.icon.selectedHoverBackground" ); defaults.remove( "CheckBox.icon.selectedPressedBackground" ); } + + // copy values + for( Map.Entry e : uiKeyCopying.entrySet() ) + defaults.put( e.getKey(), defaults.get( e.getValue() ) ); } private static Map uiKeyMapping = new HashMap<>(); + private static Map uiKeyCopying = new HashMap<>(); private static Map uiKeyInverseMapping = new HashMap<>(); private static Map checkboxKeyMapping = new HashMap<>(); private static Map checkboxDuplicateColors = new HashMap<>(); @@ -440,6 +445,12 @@ public class IntelliJTheme for( Map.Entry e : uiKeyMapping.entrySet() ) uiKeyInverseMapping.put( e.getValue(), e.getKey() ); + uiKeyCopying.put( "ToggleButton.underline.underlineColor", "TabbedPane.underlineColor" ); + uiKeyCopying.put( "ToggleButton.underline.disabledUnderlineColor", "TabbedPane.disabledUnderlineColor" ); + uiKeyCopying.put( "ToggleButton.underline.selectedBackground", "TabbedPane.selectedBackground" ); + uiKeyCopying.put( "ToggleButton.underline.hoverBackground", "TabbedPane.hoverColor" ); + uiKeyCopying.put( "ToggleButton.underline.focusBackground", "TabbedPane.focusColor" ); + checkboxKeyMapping.put( "Checkbox.Background.Default", "CheckBox.icon.background" ); checkboxKeyMapping.put( "Checkbox.Background.Disabled", "CheckBox.icon.disabledBackground" ); checkboxKeyMapping.put( "Checkbox.Border.Default", "CheckBox.icon.borderColor" );