summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-06-30 18:04:07 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-07-02 07:31:33 +0000
commit9b36f48f59ceb1066cc215039c6d48224b8edd73 (patch)
tree9bfd30bf62c02ad857b19615d3fb0ed939e67716 /src/plugins/styles/mac/qmacstyle_mac.mm
parentea8ba787abf49e540f651ee26010bb905c9a632b (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). Pick-to: 5.15 Fixes: QTBUG-85342 Change-Id: I4f0e8dd6d76e5e078a2db5c2ca63ba6bb2a661ed Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-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 beeaa14924..91611f9db5 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -5395,7 +5395,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;