Button: fixed help button styling in IntelliJ platform themes

This commit is contained in:
Karl Tauber
2019-12-01 17:53:10 +01:00
parent 3fbc21347a
commit 404e80082c
4 changed files with 19 additions and 4 deletions

View File

@@ -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

View File

@@ -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" ) );

View File

@@ -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

View File

@@ -19,5 +19,7 @@
Button.hoverBorderColor=null
Button.default.hoverBorderColor=null
Button.default.hoverBackground=@buttonHoverBackground
Button.default.pressedBackground=@buttonPressedBackground
#---- HelpButton ----
HelpButton.hoverBorderColor=null