summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-06-30 18:04:07 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-07-02 12:35:51 +0000
commitd7bdd265aa2eea59bb7359c4ae14acb2e53f36ec (patch)
tree0b14276076ddf104b3a4be7ebc127a6a1a7eb23b /src/plugins/styles
parent52c2cd0a869392d5fbae56fd22c00c309255cec1 (diff)
QMacStyle - draw inverted vertical slider correctly
Without double-inverting it (and having a knob and the blue filling mirroring each other relative to the center of the slider's bar). Fixes: QTBUG-85342 Change-Id: I4f0e8dd6d76e5e078a2db5c2ca63ba6bb2a661ed Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 9b36f48f59ceb1066cc215039c6d48224b8edd73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 06d606f05d..a3dbede1e2 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -5408,7 +5408,18 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
const CGRect barRect = [cell barRectFlipped:hasTicks];
if (drawBar) {
- [cell drawBarInside:barRect flipped:!verticalFlip];
+ if (!isHorizontal && !sl->upsideDown && (hasDoubleTicks || !hasTicks)) {
+ // The logic behind verticalFlip and upsideDown is the twisted one.
+ // Bar is the only part of the cell affected by this 'flipped'
+ // parameter in the call below, all other parts (knob, etc.) 'fixed'
+ // by scaling/translating. With ticks on one side it's not a problem
+ // at all - the bar is gray anyway. Without ticks or with ticks on
+ // the both sides, for inverted appearance and vertical orientation -
+ // we must flip so that knob and blue filling work in accordance.
+ [cell drawBarInside:barRect flipped:true];
+ } else {
+ [cell drawBarInside:barRect flipped:!verticalFlip];
+ }
// This ain't HIG kosher: force unfilled bar look.
if (hasDoubleTicks)
slider.numberOfTickMarks = numberOfTickMarks;