diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-10-18 13:16:43 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-10-18 18:55:32 +0200 |
commit | 942abaae595ea620bdeacba0f4a18b759785d61b (patch) | |
tree | fa414204e3cad8779315cb4acfcbd0fd8539f5f7 /src/plugins/styles | |
parent | e8d6accb9331cbfd07093fcbafc0d89be9054b68 (diff) |
QMacStyle: restore control size after re-initialization
We had to re-initialize NSSlider, due to some hidden problem with
stale geometry, when just setting properties of a cached control
(the remains of another previous QSlider render, using the same NSSlider).
But -initWithFrame: also resets the control size we set earlier,
thus 'small'/'mini' becoming 'normal'.
Fixes: QTBUG-107450
Pick-to: 6.4 6.2
Change-Id: Ice42c787ec65d89c1c15f9c89462b7804aafe51c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 01ff4db45f..c66131fdcd 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -432,7 +432,9 @@ static bool setupSlider(NSSlider *slider, const QStyleOptionSlider *sl) // NSSlider seems to cache values based on tracking and the last layout of the // NSView, resulting in incorrect knob rects that break the interaction with // multiple sliders. So completely reinitialize the slider. + const auto controlSize = slider.controlSize; [slider initWithFrame:sl->rect.toCGRect()]; + slider.controlSize = controlSize; slider.minValue = sl->minimum; slider.maxValue = sl->maximum; |