diff --git a/CHANGELOG.md b/CHANGELOG.md index 64a4b5b4..f3e831e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ FlatLaf Change Log - PasswordField: Reveal button did not show password if `JPasswordField.setEchoChar()` was invoked from application. (PR #442; issue #173) +- TextField: + - Improved hover/pressed/selected colors of leading/trailing buttons (e.g. + "reveal" button in password field). (issue #452) + - Clear button no longer paints over round border. (issue #451) ## 2.0-rc1 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 9307635e..187cdb48 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -367,7 +367,6 @@ Tree.hash = lighten($Tree.background,5%) focusable: false; \ toolbar.margin: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \ - background: $TextField.background; \ - toolbar.hoverBackground: lighten($TextField.background,4%,derived); \ - toolbar.pressedBackground: lighten($TextField.background,6%,derived); \ - toolbar.selectedBackground: lighten($TextField.background,12%,derived) + toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); \ + toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); \ + toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy) diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 7b43acf7..8397b161 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -920,6 +920,5 @@ Tree.icon.openColor = @icon focusable: false; \ toolbar.margin: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \ - background: $TextField.background; \ - toolbar.hoverBackground: $TextField.background; \ - toolbar.pressedBackground: $TextField.background + toolbar.hoverBackground: null; \ + toolbar.pressedBackground: null diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index 9be66470..46fad0d6 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -374,7 +374,6 @@ Tree.hash = darken($Tree.background,10%) focusable: false; \ toolbar.margin: 1,1,1,1; \ toolbar.spacingInsets: 1,1,1,1; \ - background: $TextField.background; \ - toolbar.hoverBackground: darken($TextField.background,4%,derived); \ - toolbar.pressedBackground: darken($TextField.background,8%,derived); \ - toolbar.selectedBackground: darken($TextField.background,12%,derived) + toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); \ + toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); \ + toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy) diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt index a3040e7a..96d15f65 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt @@ -1424,13 +1424,13 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI #---- [style]Button ---- -[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: $TextField.background; toolbar.pressedBackground: $TextField.background -[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived) +[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: null; toolbar.pressedBackground: null +[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy) #---- [style]ToggleButton ---- -[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: lighten($TextField.background,4%,derived); toolbar.pressedBackground: lighten($TextField.background,6%,derived); toolbar.selectedBackground: lighten($TextField.background,12%,derived) +[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy) #---- [style]ToolBar ---- diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt index fc4ffa67..071bf2df 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt @@ -1429,13 +1429,13 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI #---- [style]Button ---- -[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: $TextField.background; toolbar.pressedBackground: $TextField.background -[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived) +[style]Button.clearButton icon: com.formdev.flatlaf.icons.FlatClearIcon; focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: null; toolbar.pressedBackground: null +[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy) #---- [style]ToggleButton ---- -[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; background: $TextField.background; toolbar.hoverBackground: darken($TextField.background,4%,derived); toolbar.pressedBackground: darken($TextField.background,8%,derived); toolbar.selectedBackground: darken($TextField.background,12%,derived) +[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy) #---- [style]ToolBar ----