From 942abaae595ea620bdeacba0f4a18b759785d61b Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 18 Oct 2022 13:16:43 +0200 Subject: QMacStyle: restore control size after re-initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/styles') 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; -- cgit v1.2.3