diff --git a/CHANGELOG.md b/CHANGELOG.md index f958a1b3..e92fa2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ FlatLaf Change Log - Button: Optionally support gradient borders, gradient backgrounds and shadows for improved compatibility with IntelliJ platform themes (e.g. for Vuesion, Spacegray and Material Design Dark themes). +- Button: Fixed help button styling in IntelliJ platform themes. ## 0.20 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 7a1717c0..d9612e89 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -143,6 +143,20 @@ public class IntelliJTheme applyColorPalette( defaults ); applyCheckBoxColors( defaults ); + // IDEA uses a SVG icon for the help button, but paints the background with Button.startBackground and Button.endBackground + Object helpButtonBackground = defaults.get( "Button.startBackground" ); + Object helpButtonBorderColor = defaults.get( "Button.startBorderColor" ); + if( helpButtonBackground == null ) + helpButtonBackground = defaults.get( "Button.background" ); + if( helpButtonBorderColor == null ) + helpButtonBorderColor = defaults.get( "Button.borderColor" ); + defaults.put( "HelpButton.background", helpButtonBackground ); + defaults.put( "HelpButton.borderColor", helpButtonBorderColor ); + defaults.put( "HelpButton.disabledBackground", defaults.get( "Panel.background" ) ); + defaults.put( "HelpButton.disabledBorderColor", defaults.get( "Button.disabledBorderColor" ) ); + defaults.put( "HelpButton.focusedBorderColor", defaults.get( "Button.focusedBorderColor" ) ); + defaults.put( "HelpButton.focusedBackground", defaults.get( "Button.focusedBackground" ) ); + // IDEA uses TextField.background for editable ComboBox and Spinner defaults.put( "ComboBox.editableBackground", defaults.get( "TextField.background" ) ); defaults.put( "Spinner.background", defaults.get( "TextField.background" ) ); diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties index 5245bf4a..6fb72e06 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties @@ -25,8 +25,6 @@ Button.focusedBackground=null Button.default.background=#4A86C7 Button.default.foreground=#f0f0f0 Button.default.focusedBackground=null -Button.default.hoverBackground=#5B91CC -Button.default.pressedBackground=#6E9ED2 Button.default.borderColor=#3167ad Button.default.hoverBorderColor=#a8cef6 Button.default.focusedBorderColor=#a8cef6 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 c26c896e..ff8d4728 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 @@ -19,5 +19,7 @@ Button.hoverBorderColor=null Button.default.hoverBorderColor=null -Button.default.hoverBackground=@buttonHoverBackground -Button.default.pressedBackground=@buttonPressedBackground + +#---- HelpButton ---- + +HelpButton.hoverBorderColor=null