OS X: Retina displays and blurry QToolButton

Checkable QToolButton has a special pixmap in the background,
painted with a 'smooth pixmaps' hint. This hint also affects
how an icon on a toolbutton itself is painted later. The difference
can be quite visible on a Retina display, so this patch makes the toolbutton's
image always look the same in checked/unchecked state.

Task-number: QTBUG-35162
Change-Id: I2adc8006371fa10d89d4b77da6b3aa168aa5abc8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
bb10
Timur Pocheptsov 2014-10-20 11:28:38 +02:00
parent ae5f3df59b
commit dc267036e3
1 changed files with 2 additions and 0 deletions

View File

@ -6005,8 +6005,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
p->fillPath(path, brush);
} else if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) {
static QPixmap pm(QLatin1String(":/qt-project.org/mac/style/images/leopard-unified-toolbar-on.png"));
p->save();
p->setRenderHint(QPainter::SmoothPixmapTransform);
QStyleHelper::drawBorderPixmap(pm, p, tb->rect, 2, 2, 2, 2);
p->restore();
} else {
QPen oldPen = p->pen();
p->setPen(QColor(0, 0, 0, 0x3a));