From aca99315605109dd273a6b4a9b89be7a8def4da9 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 19 Apr 2022 16:50:27 +0200 Subject: [PATCH] IntelliJ Themes: TabbedPane: use `DefaultTabs.underlinedTabBackground` and `DefaultTabs.underlinedTabForeground` from JSON themes for selected tab background/foreground --- CHANGELOG.md | 6 ++++++ .../main/java/com/formdev/flatlaf/IntelliJTheme.java | 11 +++++++++-- .../formdev/flatlaf/IntelliJTheme$ThemeLaf.properties | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f1ae31..0e53c400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ FlatLaf Change Log ## 2.2-SNAPSHOT +#### New features and improvements + +- IntelliJ Themes: TabbedPane now use different background color for selected + tabs in all "Arc" themes, in "Hiberbee Dark" and in all "Material UI Lite" + themes. + #### Fixed bugs - Native window decorations (Windows 10/11 only): Fixed wrong window title 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 8e2c4876..c87a7776 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -162,8 +162,11 @@ public class IntelliJTheme applyCheckBoxColors( defaults ); // copy values - for( Map.Entry e : uiKeyCopying.entrySet() ) - defaults.put( e.getKey(), defaults.get( e.getValue() ) ); + for( Map.Entry e : uiKeyCopying.entrySet() ) { + Object value = defaults.get( e.getValue() ); + if( value != null ) + defaults.put( e.getKey(), value ); + } // IDEA does not paint button background if disabled, but FlatLaf does Object panelBackground = defaults.get( "Panel.background" ); @@ -612,6 +615,10 @@ public class IntelliJTheme uiKeyCopying.put( "Spinner.buttonSeparatorColor", "Component.borderColor" ); uiKeyCopying.put( "Spinner.buttonDisabledSeparatorColor", "Component.disabledBorderColor" ); + // TabbedPane + uiKeyCopying.put( "TabbedPane.selectedBackground", "DefaultTabs.underlinedTabBackground" ); + uiKeyCopying.put( "TabbedPane.selectedForeground", "DefaultTabs.underlinedTabForeground" ); + // TitlePane uiKeyCopying.put( "TitlePane.inactiveBackground", "TitlePane.background" ); uiKeyMapping.put( "TitlePane.infoForeground", "TitlePane.foreground" ); 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 05f54d76..5a2caeb9 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 @@ -162,6 +162,8 @@ ToggleButton.endBackground = $ToggleButton.background [Gruvbox_Dark_Soft]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground [Hiberbee_Dark]TabbedPane.focusColor = #5A5A5A +[Hiberbee_Dark]TabbedPane.selectedBackground = #434241 +[Hiberbee_Dark]TabbedPane.selectedForeground = #70D7FF [Hiberbee_Dark]ToggleButton.selectedBackground = $ToggleButton.selectedBackground [Hiberbee_Dark]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground