Skip to content

Commit

Permalink
macOS: Don't draw scrollbar handle when there is no range
Browse files Browse the repository at this point in the history
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.

Pick-to: 6.1 6.0 5.15
Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
AndyShawQt authored and torarnv committed Mar 18, 2021
1 parent 63a0d26 commit aac3329
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/styles/mac/qmacstyle_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5181,7 +5181,7 @@ static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect
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;

Expand Down

0 comments on commit aac3329

Please sign in to comment.