From 38d4008458db7f2d192a5b4b1d43b1962ceca887 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 10 Mar 2021 12:22:32 +0100 Subject: macOS: Don't draw scrollbar handle when there is no range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø (cherry picked from commit aac33296e618e617ab9e05b3c71682a13f2d5dfc) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm') 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(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; -- cgit v1.2.3