summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-11-21 12:26:29 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-27 16:05:17 (GMT)
commit84c38db29bb12e9debff1cb601d4f02b97c2ee89 (patch)
tree33d9a526824def932512ca89eb4233036d63a24c
parent0af360cff29fbc1182d3553255091de2cc673194 (diff)
downloadQt-84c38db29bb12e9debff1cb601d4f02b97c2ee89.zip
Qt-84c38db29bb12e9debff1cb601d4f02b97c2ee89.tar.gz
Qt-84c38db29bb12e9debff1cb601d4f02b97c2ee89.tar.bz2
Mac style: Fix selected tab text color on 10.6
This is a regression introduced by a1eaf0169f041f599895fac90570df601559a526. Task-number: QTBUG-34540 Change-Id: I3944a92f5119e0ec7c435b5b36ed4bc3d7361888 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
-rw-r--r--src/gui/styles/qmacstyle_mac.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 8fbaff4..a93d987 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3657,8 +3657,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
ThemeTabDirection ttd = getTabDirection(myTab.shape);
bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
bool selected = (myTab.state & QStyle::State_Selected);
+ bool usingModernOSX = QSysInfo::MacintoshVersion > QSysInfo::MV_10_6;
- if (selected && !myTab.documentMode)
+ if (usingModernOSX && selected && !myTab.documentMode)
myTab.palette.setColor(QPalette::WindowText, QColor(Qt::white));
// Check to see if we use have the same as the system font
@@ -3666,7 +3667,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// outside world, unless they read the source, in which case, it's
// their own fault).
bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
- if (selected || verticalTabs || nonDefaultFont || !tab->icon.isNull()
+ if ((usingModernOSX && selected) || verticalTabs || nonDefaultFont || !tab->icon.isNull()
|| !myTab.leftButtonSize.isNull() || !myTab.rightButtonSize.isNull()) {
int heightOffset = 0;
if (verticalTabs) {
@@ -3677,7 +3678,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
myTab.rect.setHeight(myTab.rect.height() + heightOffset);
- if (myTab.documentMode || selected) {
+ if (myTab.documentMode || (usingModernOSX && selected)) {
p->save();
rotateTabPainter(p, myTab.shape, myTab.rect);