Core: High-Dpi rendering of ManhattanStyle PE_PanelLineEdit

New @2x variants for inputfield.png and inputfield_disabled.png. Loading
them with Utils::StyleHelper::dpiSpecificPixmap(). Small adjustments for
resolution independent drawing of the focus/hover rect.

Change-Id: I6e1322e597c1fca7fc4ff7cce8801e99ce03e57a
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Alessandro Portale
2014-07-16 09:56:23 +02:00
parent 69ed9f561b
commit f8dfa03d4f
7 changed files with 89 additions and 56 deletions

View File

@@ -130,8 +130,8 @@ public:
};
ManhattanStylePrivate::ManhattanStylePrivate() :
lineeditImage(QLatin1String(":/core/images/inputfield.png")),
lineeditImage_disabled(QLatin1String(":/core/images/inputfield_disabled.png")),
lineeditImage(Utils::StyleHelper::dpiSpecificPixmap(QStringLiteral(":/core/images/inputfield.png")).toImage()),
lineeditImage_disabled(Utils::StyleHelper::dpiSpecificPixmap(QStringLiteral(":/core/images/inputfield_disabled.png")).toImage()),
extButtonPixmap(QLatin1String(":/core/images/extension.png")),
closeButtonPixmap(QLatin1String(Core::Constants::ICON_CLOSE))
{
@@ -463,7 +463,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
hover.setAlpha(50);
painter->setPen(QPen(hover, 1));
painter->drawRect(option->rect.adjusted(1, 1, -2 ,-2));
painter->drawRect(QRectF(option->rect).adjusted(1.5, 1.5, -1.5, -1.5));
}
painter->restore();
}