diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2011-07-04 15:40:53 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2011-07-04 15:59:55 (GMT) |
commit | f7bba6cc700f5f6b1ff6a40b8c475924de206022 (patch) | |
tree | 6cb31a236f9c388b339f665e3318e46a83c87ef2 /src | |
parent | bd219fe5dfa63049cd772d5f2c77f53f746baa2c (diff) | |
download | Qt-f7bba6cc700f5f6b1ff6a40b8c475924de206022.zip Qt-f7bba6cc700f5f6b1ff6a40b8c475924de206022.tar.gz Qt-f7bba6cc700f5f6b1ff6a40b8c475924de206022.tar.bz2 |
Lion Support: Hand made rendering of selected tab text
Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 40c28f6..efe2e7d 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3681,9 +3681,27 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled, tab->text, QPalette::WindowText); p->restore(); - } + QCommonStyle::drawControl(ce, &myTab, p, w); + } else if (qMacVersion() >= QSysInfo::MV_10_7 && (tab->state & State_Selected)) { + p->save(); + rotateTabPainter(p, myTab.shape, myTab.rect); - QCommonStyle::drawControl(ce, &myTab, p, w); + QPalette np = tab->palette; + np.setColor(QPalette::WindowText, QColor(0, 0, 0, 75)); + QRect nr = subElementRect(SE_TabBarTabText, opt, w); + nr.moveTop(-1); + int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic; + proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled, + tab->text, QPalette::WindowText); + + np.setColor(QPalette::WindowText, QColor(255, 255, 255, 255)); + nr.moveTop(-2); + proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled, + tab->text, QPalette::WindowText); + p->restore(); + } else { + QCommonStyle::drawControl(ce, &myTab, p, w); + } } else { p->save(); CGContextSetShouldAntialias(cg, true); |