From 8c56170a03bb7ce21d875a1f12561ead799ff209 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Fri, 19 Mar 2010 16:18:32 +0100 Subject: Tab color fix for document mode on Snow Leopard. The window frame/toolbar color is different (a bit lighter) for snow leopard, so we need to adjust the tab color in document mode . Reviewed-by: Richard Moe Gustavsen --- src/gui/styles/qmacstyle_mac.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 116b03e..7097291 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -237,12 +237,14 @@ void drawTabShape(QPainter *p, const QStyleOptionTabV3 *tabOpt) // fill body if (active) { - p->fillRect(rect, QColor(151, 151, 151)); + int d = (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) ? 16 : 0; + p->fillRect(rect, QColor(151 + d, 151 + d, 151 + d)); } else { + int d = (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) ? 9 : 0; QLinearGradient gradient(rect.topLeft(), rect.bottomLeft()); - gradient.setColorAt(0, QColor(207, 207, 207)); - gradient.setColorAt(0.5, QColor(206, 206, 206)); - gradient.setColorAt(1, QColor(201, 201, 201)); + gradient.setColorAt(0, QColor(207 + d, 207 + d, 207 + d)); + gradient.setColorAt(0.5, QColor(206 + d, 206 + d, 206 + d)); + gradient.setColorAt(1, QColor(201 + d, 201 + d, 201 + d)); p->fillRect(rect, gradient); } -- cgit v0.12