Commit 5f23a899 authored by Alessandro Portale's avatar Alessandro Portale

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: default avatarEike Ziller <eike.ziller@digia.com>
parent 418b45ae
......@@ -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));
......
......@@ -44,6 +44,7 @@
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
#include <utils/stylehelper.h>
#include <QColor>
#include <QFileInfo>
......@@ -247,7 +248,7 @@ LocatorWidget::LocatorWidget(Locator *qop) :
layout->addWidget(m_fileLineEdit);
setWindowIcon(QIcon(QLatin1String(":/locator/images/locator.png")));
const QPixmap image = QPixmap(QLatin1String(Core::Constants::ICON_MAGNIFIER));
const QPixmap image = Utils::StyleHelper::dpiSpecificPixmap(QLatin1String(Core::Constants::ICON_MAGNIFIER));
m_fileLineEdit->setFiltering(true);
m_fileLineEdit->setButtonPixmap(Utils::FancyLineEdit::Left, image);
m_fileLineEdit->setButtonToolTip(Utils::FancyLineEdit::Left, tr("Options"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment