Commit 033862f3 authored by Alessandro Portale's avatar Alessandro Portale

Themed Icons: Introduce Utils::Icon

Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.

Icons are now listed in per-plugin *icons.h headers.

RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.

Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 00c75cd7
......@@ -33,8 +33,8 @@
#include "historycompleter.h"
#include "hostosinfo.h"
#include "qtcassert.h"
#include "themehelper.h"
#include "stylehelper.h"
#include "utilsicons.h"
#include <QAbstractItemView>
#include <QDebug>
......@@ -365,9 +365,7 @@ void FancyLineEdit::setFiltering(bool on)
QLatin1String("edit-clear-locationbar-rtl") :
QLatin1String("edit-clear-locationbar-ltr"),
QIcon::fromTheme(QLatin1String("edit-clear"),
ThemeHelper::recoloredPixmap(
QLatin1String(":/core/images/editclear.png"),
ThemeHelper::inputfieldIconColor())));
Icons::EDIT_CLEAR.pixmap()));
setButtonPixmap(Right, icon.pixmap(16));
setButtonVisible(Right, true);
......
......@@ -30,6 +30,8 @@
#include "historycompleter.h"
#include "fancylineedit.h"
#include "theme/theme.h"
#include "utilsicons.h"
#include "qtcassert.h"
......@@ -69,7 +71,7 @@ class HistoryLineDelegate : public QItemDelegate
public:
HistoryLineDelegate(QObject *parent)
: QItemDelegate(parent)
, pixmap(QLatin1String(":/core/images/editclear.png"))
, pixmap(Icons::EDIT_CLEAR.pixmap())
{}
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
......
......@@ -28,7 +28,8 @@
**
****************************************************************************/
#include "themehelper.h"
#include "icon.h"
#include "qtcassert.h"
#include "theme/theme.h"
#include "stylehelper.h"
......@@ -37,6 +38,7 @@
#include <QImage>
#include <QMetaEnum>
#include <QPainter>
#include <QPaintEngine>
namespace Utils {
......@@ -57,29 +59,13 @@ static QPixmap maskToColorAndAlpha(const QPixmap &mask, const QColor &color)
typedef QPair<QPixmap, QColor> MaskAndColor;
typedef QList<MaskAndColor> MasksAndColors;
static MasksAndColors masksAndColors(const QString &mask, int dpr)
static MasksAndColors masksAndColors(const Icon &icon, int dpr)
{
MasksAndColors result;
const QStringList list = mask.split(QLatin1Char(','));
for (QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it) {
const QStringList items = (*it).split(QLatin1Char('|'));
const QString fileName = items.first().trimmed();
QColor color = creatorTheme()->color(Theme::IconsBaseColor);
if (items.count() > 1) {
const QString colorName = items.at(1);
static const QMetaObject &m = Theme::staticMetaObject;
static const QMetaEnum colorEnum = m.enumerator(m.indexOfEnumerator("Color"));
bool keyFound = false;
const int colorEnumKey = colorEnum.keyToValue(colorName.toLatin1().constData(), &keyFound);
if (keyFound) {
color = creatorTheme()->color(static_cast<Theme::Color>(colorEnumKey));
} else {
const QColor colorFromName(colorName);
if (colorFromName.isValid())
color = colorFromName;
}
}
const QString dprFileName = StyleHelper::availableImageResolutions(fileName).contains(dpr) ?
for (const IconMaskAndColor &i: icon) {
const QString &fileName = i.first;
const QColor color = creatorTheme()->color(i.second);
const QString dprFileName = StyleHelper::availableImageResolutions(i.first).contains(dpr) ?
StyleHelper::imageFileWithResolution(fileName, dpr) : fileName;
result.append(qMakePair(QPixmap(dprFileName), color));
}
......@@ -106,7 +92,7 @@ static QPixmap combinedMask(const MasksAndColors &masks)
QPixmap result(masks.first().first);
QPainter p(&result);
p.setCompositionMode(QPainter::CompositionMode_Darken);
MasksAndColors::const_iterator maskImage = masks.constBegin();
auto maskImage = masks.constBegin();
maskImage++;
for (;maskImage != masks.constEnd(); ++maskImage) {
p.save();
......@@ -120,7 +106,7 @@ static QPixmap combinedMask(const MasksAndColors &masks)
return result;
}
static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedMask)
static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedMask, bool shadow)
{
QPixmap result(combinedMask.size());
result.setDevicePixelRatio(combinedMask.devicePixelRatio());
......@@ -140,54 +126,97 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM
p.drawPixmap(0, 0, maskToColorAndAlpha((*maskImage).first, (*maskImage).second));
}
const QPixmap shadowMask = maskToColorAndAlpha(combinedMask, Qt::black);
p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
p.setOpacity(0.05);
p.drawPixmap(QPointF(0, -0.501), shadowMask);
p.drawPixmap(QPointF(-0.501, 0), shadowMask);
p.drawPixmap(QPointF(0.5, 0), shadowMask);
p.drawPixmap(QPointF(0.5, 0.5), shadowMask);
p.drawPixmap(QPointF(-0.501, 0.5), shadowMask);
p.setOpacity(0.2);
p.drawPixmap(0, 1, shadowMask);
if (shadow) {
const QPixmap shadowMask = maskToColorAndAlpha(combinedMask, Qt::black);
p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
p.setOpacity(0.05);
p.drawPixmap(QPointF(0, -0.501), shadowMask);
p.drawPixmap(QPointF(-0.501, 0), shadowMask);
p.drawPixmap(QPointF(0.5, 0), shadowMask);
p.drawPixmap(QPointF(0.5, 0.5), shadowMask);
p.drawPixmap(QPointF(-0.501, 0.5), shadowMask);
p.setOpacity(0.2);
p.drawPixmap(0, 1, shadowMask);
}
p.end();
return result;
}
QIcon ThemeHelper::themedIcon(const QString &mask)
static QPixmap combinedPlainPixmaps(const QVector<IconMaskAndColor> &images)
{
QIcon result;
const MasksAndColors masks = masksAndColors(mask, qRound(qApp->devicePixelRatio()));
const QPixmap combinedMask = Utils::combinedMask(masks);
result.addPixmap(masksToIcon(masks, combinedMask));
QColor disabledColor = creatorTheme()->palette().mid().color();
disabledColor.setAlphaF(0.6);
result.addPixmap(maskToColorAndAlpha(combinedMask, disabledColor), QIcon::Disabled);
QPixmap result(StyleHelper::dpiSpecificImageFile(images.first().first));
auto pixmap = images.constBegin();
pixmap++;
for (;pixmap != images.constEnd(); ++pixmap) {
const QPixmap overlay(StyleHelper::dpiSpecificImageFile((*pixmap).first));
result.paintEngine()->painter()->drawPixmap(0, 0, overlay);
}
return result;
}
QPixmap ThemeHelper::themedIconPixmap(const QString &mask)
Icon::Icon()
{
}
Icon::Icon(std::initializer_list<IconMaskAndColor> args, Style style)
: QVector<IconMaskAndColor>(args)
, m_style(style)
{
}
Icon::Icon(const QString &imageFileName)
: m_style(Style::Plain)
{
const MasksAndColors masks =
masksAndColors(mask, qRound(qApp->devicePixelRatio()));
const QPixmap combinedMask = Utils::combinedMask(masks);
return masksToIcon(masks, combinedMask);
append({imageFileName, Theme::Color(-1)});
}
QIcon Icon::icon() const
{
if (isEmpty()) {
return QIcon();
} else if (m_style == Style::Plain) {
return QIcon(combinedPlainPixmaps(*this));
} else {
QIcon result;
const MasksAndColors masks = masksAndColors(*this, qRound(qApp->devicePixelRatio()));
const QPixmap combinedMask = Utils::combinedMask(masks);
result.addPixmap(masksToIcon(masks, combinedMask, m_style == Style::TintedWithShadow));
QColor disabledColor = creatorTheme()->palette().mid().color();
disabledColor.setAlphaF(0.6);
result.addPixmap(maskToColorAndAlpha(combinedMask, disabledColor), QIcon::Disabled);
return result;
}
}
QPixmap Icon::pixmap() const
{
if (isEmpty()) {
return QPixmap();
} else if (m_style == Style::Plain) {
return combinedPlainPixmaps(*this);
} else {
const MasksAndColors masks =
masksAndColors(*this, qRound(qApp->devicePixelRatio()));
const QPixmap combinedMask = Utils::combinedMask(masks);
return masksToIcon(masks, combinedMask, m_style == Style::TintedWithShadow);
}
}
QPixmap ThemeHelper::recoloredPixmap(const QString &maskImage, const QColor &color)
QString Icon::imageFileName() const
{
return maskToColorAndAlpha(QPixmap(Utils::StyleHelper::dpiSpecificImageFile(maskImage)), color);
QTC_ASSERT(length() == 1, return QString());
return first().first;
}
QColor ThemeHelper::inputfieldIconColor()
Icon& Icon::operator=(const Icon &other)
{
// See QLineEdit::paintEvent
QColor color = QApplication::palette().text().color();
color.setAlpha(128);
return color;
clear();
append(other);
m_style = other.m_style;
return *this;
}
} // namespace Utils
......@@ -32,29 +32,47 @@
#define THEMEHELPER_H
#include "utils_global.h"
#include "theme/theme.h"
#include <QPair>
#include <QVector>
QT_FORWARD_DECLARE_CLASS(QColor)
QT_FORWARD_DECLARE_CLASS(QIcon)
QT_FORWARD_DECLARE_CLASS(QPixmap)
QT_FORWARD_DECLARE_CLASS(QString)
namespace Utils {
class QTCREATOR_UTILS_EXPORT ThemeHelper
typedef QPair<QString, Theme::Color> IconMaskAndColor;
// Returns a recolored icon with shadow and custom disabled state for a
// series of grayscalemask|Theme::Color mask pairs
class QTCREATOR_UTILS_EXPORT Icon : public QVector<IconMaskAndColor>
{
public:
// Returns a recolored icon with shadow and custom disabled state for a
// grayscale mask. The mask can range from a single image filename to
// a list of filename|color,... pairs.
// The color can be a Theme::Color enum key name. If invalid, it is run
// through QColor(const QString &name).
static QIcon themedIcon(const QString &mask);
// Same as themedIcon() but without disabled state.
static QPixmap themedIconPixmap(const QString &mask);
// Simple recoloring of a mask. No shadow. maskImage is a single file.
static QPixmap recoloredPixmap(const QString &maskImage, const QColor &color);
static QColor inputfieldIconColor();
enum class Style {
Plain,
Tinted,
TintedWithShadow
};
Icon();
Icon(std::initializer_list<IconMaskAndColor> args, Style style = Style::TintedWithShadow);
Icon(const QString &imageFileName);
QIcon icon() const;
// Same as icon() but without disabled state.
QPixmap pixmap() const;
// Try to avoid it. it is just there for special API cases in Qt Creator
// where icons are still defined as filename.
QString imageFileName() const;
Icon& Icon::operator=(const Icon &other);
private:
Style m_style = Style::Plain;
};
} // namespace Utils
......
......@@ -89,12 +89,12 @@ SOURCES += $$PWD/environment.cpp \
$$PWD/proxycredentialsdialog.cpp \
$$PWD/macroexpander.cpp \
$$PWD/theme/theme.cpp \
$$PWD/themehelper.cpp \
$$PWD/progressindicator.cpp \
$$PWD/fadingindicator.cpp \
$$PWD/overridecursor.cpp \
$$PWD/categorysortfiltermodel.cpp \
$$PWD/dropsupport.cpp
$$PWD/dropsupport.cpp \
$$PWD/icon.cpp
win32:SOURCES += $$PWD/consoleprocess_win.cpp
else:SOURCES += $$PWD/consoleprocess_unix.cpp
......@@ -194,13 +194,14 @@ HEADERS += \
$$PWD/macroexpander.h \
$$PWD/theme/theme.h \
$$PWD/theme/theme_p.h \
$$PWD/themehelper.h \
$$PWD/progressindicator.h \
$$PWD/fadingindicator.h \
$$PWD/executeondestruction.h \
$$PWD/overridecursor.h \
$$PWD/categorysortfiltermodel.h \
$$PWD/dropsupport.h
$$PWD/dropsupport.h \
$$PWD/utilsicons.h \
$$PWD/icon.h
FORMS += $$PWD/filewizardpage.ui \
$$PWD/projectintropage.ui \
......
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef UTILSICONS_H
#define UTILSICONS_H
#include "icon.h"
namespace Utils {
namespace Icons {
const Utils::Icon EDIT_CLEAR({
{QLatin1String(":/core/images/editclear.png"), Utils::Theme::BackgroundColorHover}}, Utils::Icon::Style::Tinted);
} // namespace Icons
} // namespace Utils
#endif // UTILSICONS_H
......@@ -29,7 +29,8 @@ HEADERS += \
analyzerutils.h \
detailederrorview.h \
diagnosticlocation.h \
startremotedialog.h
startremotedialog.h \
analyzericons.h
RESOURCES += \
analyzerbase.qrc
......@@ -16,6 +16,7 @@ QtcPlugin {
"analyzerbase.qrc",
"analyzerbase_global.h",
"analyzerconstants.h",
"analyzericons",
"analyzermanager.cpp",
"analyzermanager.h",
"analyzerplugin.cpp",
......
......@@ -53,9 +53,6 @@ const char G_ANALYZER_TOOLS[] = "Menu.Group.Analyzer.Tools";
const char G_ANALYZER_REMOTE_TOOLS[] = "Menu.Group.Analyzer.RemoteTools";
const char G_ANALYZER_OPTIONS[] = "Menu.Group.Analyzer.Options";
// Manager controls.
const char ANALYZER_CONTROL_START_ICON[] = ":/images/analyzer_overlay_small.png,:/core/images/run_overlay_small.png|IconsRunColor";
const char ANALYZERTASK_ID[] = "Analyzer.TaskId";
} // namespace Constants
......
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef ANALYZERICONS_H
#define ANALYZERICONS_H
#include <utils/icon.h>
namespace Analyzer {
namespace Icons {
const Utils::Icon ANALYZER_CONTROL_START({
{QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor},
{QLatin1String(":/core/images/run_overlay_small.png"), Utils::Theme::IconsRunColor}});
} // namespace Icons
} // namespace Analyzer
#endif // ANALYZERICONS_H
......@@ -31,6 +31,7 @@
#include "analyzermanager.h"
#include "analyzericons.h"
#include "analyzerplugin.h"
#include "analyzerstartparameters.h"
#include "ianalyzertool.h"
......@@ -49,6 +50,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/project.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/session.h>
......@@ -61,7 +63,6 @@
#include <utils/qtcassert.h>
#include <utils/checkablemessagebox.h>
#include <utils/statuslabel.h>
#include <utils/themehelper.h>
#include <QVariant>
#include <QDebug>
......@@ -241,16 +242,14 @@ void AnalyzerManagerPrivate::setupActions()
menubar->addMenu(mtools, m_menu);
m_startAction = new QAction(tr("Start"), m_menu);
m_startAction->setIcon(Utils::ThemeHelper::themedIcon(
QLatin1String(ANALYZER_CONTROL_START_ICON)));
m_startAction->setIcon(Analyzer::Icons::ANALYZER_CONTROL_START.icon());
ActionManager::registerAction(m_startAction, "Analyzer.Start");
connect(m_startAction, &QAction::triggered,
this, &AnalyzerManagerPrivate::startCurrentTool);
m_stopAction = new QAction(tr("Stop"), m_menu);
m_stopAction->setEnabled(false);
m_stopAction->setIcon(Utils::ThemeHelper::themedIcon(
QLatin1String(ProjectExplorer::Constants::ICON_STOP_SMALL)));
m_stopAction->setIcon(ProjectExplorer::Icons::STOP_SMALL.icon());
command = ActionManager::registerAction(m_stopAction, "Analyzer.Stop");
m_menu->addAction(command, G_ANALYZER_CONTROL);
......
......@@ -29,6 +29,7 @@
**
****************************************************************************/
#include "analyzericons.h"
#include "analyzerruncontrol.h"
#include "ianalyzertool.h"
#include "analyzermanager.h"
......@@ -51,7 +52,7 @@ AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
: RunControl(runConfiguration, sp.runMode)
{
setIcon(QLatin1String(Constants::ANALYZER_CONTROL_START_ICON));
setIcon(Icons::ANALYZER_CONTROL_START);
m_sp = sp;
......
......@@ -32,7 +32,7 @@
#include "diagnosticlocation.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/editormanager/editormanager.h>
#include <utils/qtcassert.h>
......@@ -132,7 +132,7 @@ DetailedErrorView::DetailedErrorView(QWidget *parent) :
setItemDelegateForColumn(LocationColumn, new Internal::DetailedErrorDelegate(this));
m_copyAction->setText(tr("Copy"));
m_copyAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_COPY)));
m_copyAction->setIcon(Core::Icons::COPY.icon());
m_copyAction->setShortcut(QKeySequence::Copy);
m_copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(m_copyAction, &QAction::triggered, [this] {
......
......@@ -36,7 +36,7 @@
#include "androidmanager.h"
#include "ui_androidbuildapkwidget.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
......@@ -44,7 +44,6 @@
#include <utils/fancylineedit.h>
#include <utils/pathchooser.h>
#include <utils/themehelper.h>
#include <QFileDialog>
......@@ -91,12 +90,10 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step)
m_ui->KeystoreLocationPathChooser->setInitialBrowsePathBackup(QDir::homePath());
m_ui->KeystoreLocationPathChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)"));
m_ui->KeystoreLocationPathChooser->setPromptDialogTitle(tr("Select Keystore File"));
m_ui->signingDebugWarningIcon->setPixmap(
Utils::ThemeHelper::themedIconPixmap(QLatin1String(Core::Constants::ICON_WARNING)));
m_ui->signingDebugWarningIcon->setPixmap(Core::Icons::WARNING.pixmap());
m_ui->signingDebugWarningIcon->hide();
m_ui->signingDebugWarningLabel->hide();
m_ui->signingDebugDeployErrorIcon->setPixmap(
Utils::ThemeHelper::themedIconPixmap(QLatin1String(Core::Constants::ICON_ERROR)));
m_ui->signingDebugDeployErrorIcon->setPixmap(Core::Icons::ERROR.pixmap());
signPackageCheckBoxToggled(m_step->signPackage());
m_ui->useGradleCheckBox->setChecked(m_step->useGradle());
......
......@@ -35,7 +35,7 @@
#include "androidmanager.h"
#include "androidqtsupport.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/icore.h>
#include <coreplugin/infobar.h>
#include <coreplugin/editormanager/ieditor.h>
......@@ -50,7 +50,6 @@
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditor.h>
#include <utils/algorithm.h>
#include <utils/themehelper.h>
#include <QLineEdit>
#include <QFileInfo>
......@@ -167,8 +166,7 @@ void AndroidManifestEditorWidget::initializePage()
m_packageNameWarning->setVisible(false);
m_packageNameWarningIcon = new QLabel;
m_packageNameWarningIcon->setPixmap(
Utils::ThemeHelper::themedIconPixmap(QLatin1String(Core::Constants::ICON_WARNING)));
m_packageNameWarningIcon->setPixmap(Core::Icons::WARNING.pixmap());
m_packageNameWarningIcon->setVisible(false);
m_packageNameWarningIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
......
......@@ -33,8 +33,7 @@
#include "androidconfigurations.h"
#include <utils/detailswidget.h>
#include <utils/themehelper.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/icore.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kit.h>
......@@ -93,7 +92,7 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
: Utils::DetailsWidget(parent)
{
setSummaryText(QLatin1String("<b>Android has not been configured. Create Android kits.</b>"));
setIcon(Utils::ThemeHelper::themedIcon(QLatin1String(Core::Constants::ICON_WARNING)));
setIcon(Core::Icons::WARNING.icon());
//detailsWidget->setState(Utils::DetailsWidget::NoSummary);
QWidget *mainWidget = new QWidget(this);
setWidget(mainWidget);
......
......@@ -35,6 +35,7 @@
#include "androidrunner.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorericons.h>
using namespace ProjectExplorer;
......@@ -46,7 +47,7 @@ AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
, m_runner(new AndroidRunner(this, rc, ProjectExplorer::Constants::NORMAL_RUN_MODE))
, m_running(false)
{
setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
setIcon(Icons::RUN_SMALL);
}
AndroidRunControl::~AndroidRunControl()
......
......@@ -36,11 +36,10 @@
#include "androidconstants.h"
#include "androidtoolchain.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
#include <utils/themehelper.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kitinformation.h>
......@@ -176,13 +175,11 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_ui->downloadAntToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost());
const QPixmap warningPixmap = Utils::ThemeHelper::themedIconPixmap(
QLatin1String(Core::Constants::ICON_WARNING));
const QPixmap warningPixmap = Core::Icons::WARNING.pixmap();