From d5e9fd0e5c2f81fd6bdfaef8cf654ec5a44f8d52 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Thu, 23 Apr 2020 23:46:14 +0200 Subject: [PATCH] IntelliJ Themes: - fixed ComboBox size and Spinner border in all Material UI Lite themes - limit tree row height in all Material UI Lite themes and some other themes --- .../main/java/com/formdev/flatlaf/IntelliJTheme.java | 10 ++++++++++ 1 file changed, 10 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 835f2daa..decacbf7 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -194,6 +194,11 @@ public class IntelliJTheme if( !uiKeys.contains( "ToggleButton.foreground" ) && uiKeys.contains( "Button.foreground" ) ) defaults.put( "ToggleButton.foreground", defaults.get( "Button.foreground" ) ); + // limit tree row height + int rowHeight = defaults.getInt( "Tree.rowHeight" ); + if( rowHeight > 22 ) + defaults.put( "Tree.rowHeight", 22 ); + // apply theme specific UI defaults at the end to allow overwriting defaults.putAll( themeSpecificDefaults ); } @@ -249,6 +254,11 @@ public class IntelliJTheme } else { uiKeys.add( key ); + // fix ComboBox size and Spinner border in all Material UI Lite themes + boolean isMaterialUILite = author.equals( "Mallowigi" ); + if( isMaterialUILite && (key.equals( "ComboBox.padding" ) || key.equals( "Spinner.border" )) ) + return; // ignore + // map keys key = uiKeyMapping.getOrDefault( key, key ); if( key.isEmpty() )