diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-11-10 15:04:58 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-15 11:08:16 +0000 |
commit | a45b4c6e70de5a93792e37810c36f23a8f4cecef (patch) | |
tree | 55a8a7fead5736f6b87ff89eb6c13a90af0577b6 /src | |
parent | 60cfceea2516f94ca6a96c8cc93190ed550a60fb (diff) |
macOS: make the slider knob big enough for BigSur and Monterey
The slider is very touch friendly from macOS 11 on, and the knob is quite
large. Give it some extra pixels, and adjust the test accordingly.
Task-number: QTBUG-98093
Change-Id: Iedf6db1081cdd4013ca29ce760aea1e0361b1123
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 6ff07ec23b562d78f7fa19b5c6ada72724dc81a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index e3f38cf8a0..f2919ec1b5 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -844,6 +844,8 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QStyleOption return ret; } + const bool isBigSurOrAbove = QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSBigSur; + if (ct == QStyle::CT_CustomBase && widg) { #if QT_CONFIG(pushbutton) if (qobject_cast<const QPushButton *>(widg)) @@ -1024,6 +1026,8 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QStyleOption w = qt_mac_aqua_get_metric(HSliderHeight); if (sld->tickPosition != QSlider::NoTicks) w += qt_mac_aqua_get_metric(HSliderTickHeight); + else if (isBigSurOrAbove) + w += 3; } else { w = qt_mac_aqua_get_metric(VSliderWidth); if (sld->tickPosition != QSlider::NoTicks) |