Core: Use enable the use of magnifier@2x.png

magnifier@2x.png was already part of the core plugin, but never used
since the @2x logic is in QIcon and for the magnifier.png we use QPixmap
for loading.
This patch uses Utils::StyleHelper::dpiSpecificPixmap() to load the
image in the findtoolbar and locatorwidget. It also removes the image
centering code in FindToolBar::updateIcons() (most likely a by now
obsolete workaround) since the image gets properly centered in the
Utils::FancyLineEdit.

Change-Id: I5cd6d22fc5cce3838db6164568cb9165da052c49
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Alessandro Portale
2014-07-15 15:25:32 +02:00
parent 418b45ae66
commit 5f23a89947
2 changed files with 5 additions and 7 deletions

View File

@@ -42,6 +42,7 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
#include <QDebug>
#include <QSettings>
@@ -567,12 +568,8 @@ void FindToolBar::updateIcons()
bool regexp = effectiveFlags & FindRegularExpression;
bool preserveCase = effectiveFlags & FindPreserveCase;
if (!casesensitive && !wholewords && !regexp && !preserveCase) {
QPixmap pixmap(17, 17);
pixmap.fill(Qt::transparent);
QPainter painter(&pixmap);
const QPixmap mag = QPixmap(QLatin1String(Core::Constants::ICON_MAGNIFIER));
painter.drawPixmap(0, (pixmap.height() - mag.height()) / 2, mag);
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left,
Utils::StyleHelper::dpiSpecificPixmap(QLatin1Literal(Core::Constants::ICON_MAGNIFIER)));
} else {
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left,
IFindFilter::pixmapForFindFlags(effectiveFlags));