diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-06-04 11:45:00 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-06-04 11:46:16 (GMT) |
commit | 84e2c537c48122ec6ada0becca701b3b4b6715b1 (patch) | |
tree | c9096e827a37c543dc03bc27c3da780e8f0b0268 /src/gui/styles | |
parent | e3a562e8d2e5767eef0070dacc01859c0acc142f (diff) | |
download | Qt-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.mm | 14 |
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: |