summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-04 11:45:00 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-06-04 11:46:16 (GMT)
commit84e2c537c48122ec6ada0becca701b3b4b6715b1 (patch)
treec9096e827a37c543dc03bc27c3da780e8f0b0268 /src/gui/styles
parente3a562e8d2e5767eef0070dacc01859c0acc142f (diff)
downloadQt-84e2c537c48122ec6ada0becca701b3b4b6715b1.zip
Qt-84e2c537c48122ec6ada0becca701b3b4b6715b1.tar.gz
Qt-84e2c537c48122ec6ada0becca701b3b4b6715b1.tar.bz2
Make inverted appearance work for progressbar in QMacStyle
HITheme doesn't seem to support the reverse thing. I filled a bug about it, but this is easy to emulate in the horizontal case and the "Inverted" orientation works great for vertical. Task-number: 217594 Reviewed-by: Morten Sørvig
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qmacstyle_mac.mm14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 43efedf..99894ad 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -4339,7 +4339,19 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
tdi.enableState = kThemeTrackDisabled;
else
tdi.enableState = kThemeTrackActive;
- HIThemeDrawTrack(&tdi, 0, cg, kHIThemeOrientationNormal);
+ HIThemeOrientation drawOrientation = kHIThemeOrientationNormal;
+ if (reverse) {
+ if (vertical) {
+ drawOrientation = kHIThemeOrientationInverted;
+ } else {
+ CGContextSaveGState(cg);
+ CGContextTranslateCTM(cg, pb->rect.width(), 0);
+ CGContextScaleCTM(cg, -1, 1);
+ }
+ }
+ HIThemeDrawTrack(&tdi, 0, cg, drawOrientation);
+ if (reverse && !vertical)
+ CGContextRestoreGState(cg);
}
break;
case CE_ProgressBarLabel: