diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java index 8984e838..bbff8cf0 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatLaf.java @@ -284,6 +284,7 @@ public abstract class FlatLaf // initialize some defaults (for overriding) that are used in UI delegates, // but are not set in BasicLookAndFeel putDefaults( defaults, defaults.getColor( "control" ), + "Button.disabledBackground", "EditorPane.disabledBackground", "EditorPane.inactiveBackground", "FormattedTextField.disabledBackground", @@ -293,7 +294,8 @@ public abstract class FlatLaf "TextArea.inactiveBackground", "TextField.disabledBackground", "TextPane.disabledBackground", - "TextPane.inactiveBackground" ); + "TextPane.inactiveBackground", + "ToggleButton.disabledBackground" ); putDefaults( defaults, defaults.getColor( "textInactiveText" ), "Button.disabledText", "CheckBox.disabledText", 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 5c5119ff..c215ad16 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/IntelliJTheme.java @@ -147,6 +147,11 @@ public class IntelliJTheme applyColorPalette( defaults ); applyCheckBoxColors( defaults ); + // IDEA does not paint button background if disabled, but FlatLaf does + Object panelBackground = defaults.get( "Panel.background" ); + defaults.put( "Button.disabledBackground", panelBackground ); + defaults.put( "ToggleButton.disabledBackground", panelBackground ); + // 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" ); @@ -156,7 +161,7 @@ public class IntelliJTheme 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.disabledBackground", panelBackground ); defaults.put( "HelpButton.disabledBorderColor", defaults.get( "Button.disabledBorderColor" ) ); defaults.put( "HelpButton.focusedBorderColor", defaults.get( "Button.focusedBorderColor" ) ); defaults.put( "HelpButton.focusedBackground", defaults.get( "Button.focusedBackground" ) ); diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt index 2e856d91..43933ba7 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatDarkLaf_1.8.0_202.txt @@ -77,6 +77,7 @@ Button.default.hoverBackground #3b5f8b com.formdev.flatlaf.util.DerivedColor Button.default.hoverBorderColor #537699 javax.swing.plaf.ColorUIResource [UI] Button.default.pressedBackground #3f6796 com.formdev.flatlaf.util.DerivedColor [UI] lighten(6% autoInverse) Button.defaultButtonFollowsFocus true +Button.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] Button.disabledBorderColor #5e6060 javax.swing.plaf.ColorUIResource [UI] Button.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] Button.focusedBorderColor #466d94 javax.swing.plaf.ColorUIResource [UI] @@ -1059,6 +1060,7 @@ TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI ToggleButton.background #4c5052 javax.swing.plaf.ColorUIResource [UI] ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ToggleButton.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #53585a com.formdev.flatlaf.util.DerivedColor [UI] lighten(3% autoInverse) ToggleButton.disabledText #777777 javax.swing.plaf.ColorUIResource [UI] ToggleButton.font [active] $defaultFont [UI] diff --git a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt index 75227d5f..700c3e04 100644 --- a/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt +++ b/flatlaf-testing/src/main/resources/com/formdev/flatlaf/testing/uidefaults/FlatLightLaf_1.8.0_202.txt @@ -77,6 +77,7 @@ Button.default.hoverBackground #f7f7f7 com.formdev.flatlaf.util.DerivedColor Button.default.hoverBorderColor #87afda javax.swing.plaf.ColorUIResource [UI] Button.default.pressedBackground #e6e6e6 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse) Button.defaultButtonFollowsFocus true +Button.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] Button.disabledBorderColor #cfcfcf javax.swing.plaf.ColorUIResource [UI] Button.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] Button.focusedBackground #e3f1fa javax.swing.plaf.ColorUIResource [UI] @@ -1061,6 +1062,7 @@ TitledPanelUI com.formdev.flatlaf.swingx.ui.FlatTitledPanelUI ToggleButton.background #ffffff javax.swing.plaf.ColorUIResource [UI] ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatButtonBorder [UI] ToggleButton.darkShadow #9e9e9e javax.swing.plaf.ColorUIResource [UI] +ToggleButton.disabledBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI] ToggleButton.disabledSelectedBackground #dedede com.formdev.flatlaf.util.DerivedColor [UI] darken(13% autoInverse) ToggleButton.disabledText #8c8c8c javax.swing.plaf.ColorUIResource [UI] ToggleButton.font [active] $defaultFont [UI]