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>
This commit is contained in:
parent
ea8ba787ab
commit
9b36f48f59
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user