summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2021-03-10 12:22:32 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-20 16:25:23 +0000
commit38d4008458db7f2d192a5b4b1d43b1962ceca887 (patch)
treedb5c89ff83720025545b7d374390ec9c807eeb7c /src/plugins/styles/mac/qmacstyle_mac.mm
parentd49a37a5e7b1a8755b8dab66af9ba103abcd9b70 (diff)
macOS: Don't draw scrollbar handle when there is no range
If the minimum and maximum is set to be the same then we should not draw the handle. An empty groove should be shown instead. Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit aac33296e618e617ab9e05b3c71682a13f2d5dfc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 1d924fd0d0..208a7b9323 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -5175,7 +5175,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
const bool drawTrack = sb->subControls & SC_ScrollBarGroove;
- const bool drawKnob = sb->subControls & SC_ScrollBarSlider;
+ const bool drawKnob = sb->subControls & SC_ScrollBarSlider && sb->minimum != sb->maximum;
if (!drawTrack && !drawKnob)
break;