diff --git a/CHANGELOG.md b/CHANGELOG.md index 594c1069..9b6e08a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ FlatLaf Change Log #1068) - Popup: Fixed scrolling popup painting issue on Windows 10 when a glass pane is visible and frame is maximized. (issue #1071) +- Slider: Styling `thumbSize` or `focusWidth` did not update slider size/layout. + (PR #1074) - ToolBar: Grip disappeared when switching between Look and Feels. (issue #1075) - Extras: - UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java index 7870f054..a830fdf3 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java @@ -227,7 +227,13 @@ public class FlatSliderUI /** @since 2 */ protected void applyStyle( Object style ) { + Dimension oldThumbSize = thumbSize; + int oldFocusWidth = focusWidth; + oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); + + if( !thumbSize.equals( oldThumbSize ) || focusWidth != oldFocusWidth ) + calculateGeometry(); } /** @since 2 */