diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 4d6252f..b88d2ed 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3349,7 +3349,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QColor light = down ? Qt::black : Qt::white; light.setAlphaF(0.375f); p->setPen(light); - p->drawText(cr.adjusted(0, 1, 0, 1), alignment, tb->text); + p->drawText(cr.adjusted(0, -3, 0, 1), alignment, tb->text); p->setPen(pen); if (down && tbstyle == Qt::ToolButtonTextOnly) { pal = QApplication::palette("QMenu"); @@ -3357,12 +3357,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter role = QPalette::HighlightedText; } } - proxy()->drawItemText(p, cr, alignment, pal, + proxy()->drawItemText(p, cr.adjusted(0, -4, 0, 0), alignment, pal, tb->state & State_Enabled, tb->text, role); if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && (tb->state & State_Sunken)) { // Draw a "drop shadow" in earlier versions. - proxy()->drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, + proxy()->drawItemText(p, cr.adjusted(0, -3, 0, 1), alignment, tb->palette, tb->state & State_Enabled, tb->text); } } @@ -5066,10 +5066,27 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex drawToolbarButtonArrow(tb->rect, tds, cg); } if (tb->state & State_On) { - if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { + if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_5) { static QPixmap pm(QLatin1String(":/trolltech/mac/style/images/leopard-unified-toolbar-on.png")); p->setRenderHint(QPainter::SmoothPixmapTransform); - QStyleHelper::drawBorderPixmap(pm, p, tb->rect, 2, 2, 2, 2); + + QStyleHelper::drawBorderPixmap(pm, p, tb->rect.adjusted(0,0,0,0), 2, 2, 2, 2); + } + else if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { + if(widget->window()->isActiveWindow()) + { + static QPixmap pm(QLatin1String(":/trolltech/mac/style/images/snow-leopard-unified-toolbar-on.png")); + p->setRenderHint(QPainter::SmoothPixmapTransform); + + QStyleHelper::drawBorderPixmap(pm, p, tb->rect.adjusted(0,0,0,0), 2, 2, 2, 2); + } + else + { + static QPixmap pm(QLatin1String(":/trolltech/mac/style/images/snow-leopard-unified-toolbar-on-unfocused.png")); + p->setRenderHint(QPainter::SmoothPixmapTransform); + + QStyleHelper::drawBorderPixmap(pm, p, tb->rect.adjusted(0,0,0,0), 2, 2, 2, 2); + } } else { QPen oldPen = p->pen(); p->setPen(QColor(0, 0, 0, 0x3a));