diff options
Diffstat (limited to 'src/gui/styles/qmacstyle_mac.mm')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 40c28f6..321db25 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); + + 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); - QCommonStyle::drawControl(ce, &myTab, p, w); + 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); @@ -4707,7 +4725,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex HIThemeFrameDrawInfo fdi; fdi.version = qt_mac_hitheme_version; - fdi.state = tds; + fdi.state = ((sb->state & State_ReadOnly) || !(sb->state & State_Enabled)) ? kThemeStateInactive : kThemeStateActive; fdi.kind = kHIThemeFrameTextFieldSquare; fdi.isFocused = false; HIRect hirect = qt_hirectForQRect(lineeditRect); |