Skip to content

Commit c995b4c

Browse files
committed
Merge PR #1074: Recalculate geometry after styling in FlatSliderUI
2 parents b251ff7 + 7e6dc26 commit c995b4c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ FlatLaf Change Log
77
#1068)
88
- Popup: Fixed scrolling popup painting issue on Windows 10 when a glass pane is
99
visible and frame is maximized. (issue #1071)
10+
- Slider: Styling `thumbSize` or `focusWidth` did not update slider size/layout.
11+
(PR #1074)
1012
- ToolBar: Grip disappeared when switching between Look and Feels. (issue #1075)
1113
- Extras:
1214
- UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also

flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSliderUI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,13 @@ protected void installStyle() {
227227

228228
/** @since 2 */
229229
protected void applyStyle( Object style ) {
230+
Dimension oldThumbSize = thumbSize;
231+
int oldFocusWidth = focusWidth;
232+
230233
oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
234+
235+
if( !thumbSize.equals( oldThumbSize ) || focusWidth != oldFocusWidth )
236+
calculateGeometry();
231237
}
232238

233239
/** @since 2 */

0 commit comments

Comments
 (0)