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: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2015-11-23 16:41:54 +01:00
parent 00c75cd7eb
commit 033862f305
139 changed files with 1090 additions and 629 deletions

View File

@@ -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());

View File

@@ -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);

View File

@@ -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);

View File

@@ -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()

View File

@@ -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();
m_ui->jdkWarningIconLabel->setPixmap(warningPixmap);
m_ui->kitWarningIconLabel->setPixmap(warningPixmap);
const QPixmap errorPixmap = Utils::ThemeHelper::themedIconPixmap(
QLatin1String(Core::Constants::ICON_ERROR));
const QPixmap errorPixmap = Core::Icons::ERROR.pixmap();
m_ui->sdkWarningIconLabel->setPixmap(errorPixmap);
m_ui->gdbWarningIconLabel->setPixmap(errorPixmap);
m_ui->ndkWarningIconLabel->setPixmap(errorPixmap);

View File

@@ -31,9 +31,8 @@
#include "avddialog.h"
#include "androidconfigurations.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <utils/tooltip/tooltip.h>
#include <utils/themehelper.h>
#include <QKeyEvent>
#include <QMessageBox>
@@ -63,8 +62,7 @@ AvdDialog::AvdDialog(int minApiLevel, const QString &targetArch, const AndroidCo
m_avdDialog.nameLineEdit->setValidator(v);
m_avdDialog.nameLineEdit->installEventFilter(this);
m_avdDialog.warningIcon->setPixmap(Utils::ThemeHelper::themedIconPixmap(
QLatin1String(Core::Constants::ICON_WARNING)));
m_avdDialog.warningIcon->setPixmap(Core::Icons::WARNING.pixmap());
updateApiLevelComboBox();