diff --git a/CHANGELOG.md b/CHANGELOG.md index e0b9a9ed..e9f7302e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ FlatLaf Change Log - PasswordField: Reveal button did not show password if `JPasswordField.setEchoChar()` was invoked from application. (PR #442; issue #173) +- Slider: Fixed/improved focused indicator color when changing accent color. (PR + #375) - TextField: - Improved hover/pressed/selected colors of leading/trailing buttons (e.g. "reveal" button in password field). (issue #452) 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 187cdb48..28e159a6 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -289,7 +289,7 @@ Slider.trackValueColor = @accentSliderColor Slider.trackColor = lighten(@background,15%) Slider.thumbColor = $Slider.trackValueColor Slider.tickColor = @disabledForeground -Slider.focusedColor = fade($Component.focusColor,70%,derived) +Slider.focusedColor = fade(changeLightness($Component.focusColor,60%,derived),30%,derived) Slider.hoverThumbColor = lighten($Slider.thumbColor,5%,derived) Slider.pressedThumbColor = lighten($Slider.thumbColor,8%,derived) Slider.disabledTrackColor = lighten(@background,10%) 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 46fad0d6..1c67c8ed 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -296,7 +296,7 @@ Slider.trackValueColor = @accentSliderColor Slider.trackColor = darken(@background,18%) Slider.thumbColor = $Slider.trackValueColor Slider.tickColor = @disabledForeground -Slider.focusedColor = fade($Component.focusColor,50%,derived) +Slider.focusedColor = fade(changeLightness($Component.focusColor,75%,derived),50%,derived) Slider.hoverThumbColor = darken($Slider.thumbColor,5%,derived) Slider.pressedThumbColor = darken($Slider.thumbColor,8%,derived) Slider.disabledTrackColor = darken(@background,13%) diff --git a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt index 96d15f65..63e39f3e 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatDarkLaf_1.8.0.txt @@ -932,7 +932,7 @@ Slider.disabledTrackColor #54595c HSL 203 5 35 javax.swing.plaf.Colo Slider.focus #7a7d7f HSL 204 2 49 javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] Slider.focusWidth 4 -Slider.focusedColor #3c628cb3 70% HSLA 212 40 39 70 com.formdev.flatlaf.util.DerivedColor [UI] fade(70%) +Slider.focusedColor #7097c24d 30% HSLA 211 40 60 30 com.formdev.flatlaf.util.DerivedColor [UI] changeLightness(60%) fade(30%) Slider.font [active] $defaultFont [UI] Slider.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt index 071bf2df..09cdb33c 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatLightLaf_1.8.0.txt @@ -937,7 +937,7 @@ Slider.disabledTrackColor #d1d1d1 HSL 0 0 82 javax.swing.plaf.Colo Slider.focus #9c9c9c HSL 0 0 61 javax.swing.plaf.ColorUIResource [UI] Slider.focusInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI] Slider.focusWidth 4 -Slider.focusedColor #98c3eb80 50% HSLA 209 67 76 50 com.formdev.flatlaf.util.DerivedColor [UI] fade(50%) +Slider.focusedColor #94c1ea80 50% HSLA 209 67 75 50 com.formdev.flatlaf.util.DerivedColor [UI] changeLightness(75%) fade(50%) Slider.font [active] $defaultFont [UI] Slider.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] Slider.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI] diff --git a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0.txt b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0.txt index 7dcba7ad..e1879044 100644 --- a/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0.txt +++ b/flatlaf-testing/dumps/uidefaults/FlatTestLaf_1.8.0.txt @@ -1442,7 +1442,7 @@ 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.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