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

@@ -32,7 +32,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/editormanager/documentmodel.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/editormanager_p.h>
@@ -43,7 +43,6 @@
#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <utils/themehelper.h>
#include <QApplication>
#include <QComboBox>
@@ -100,13 +99,13 @@ EditorToolBarPrivate::EditorToolBarPrivate(QWidget *parent, EditorToolBar *q) :
m_lockButton(new QToolButton(q)),
m_dragHandle(new QToolButton(q)),
m_dragHandleMenu(0),
m_goBackAction(new QAction(Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_PREV)), EditorManager::tr("Go Back"), parent)),
m_goForwardAction(new QAction(Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_NEXT)), EditorManager::tr("Go Forward"), parent)),
m_goBackAction(new QAction(Icons::PREV.icon(), EditorManager::tr("Go Back"), parent)),
m_goForwardAction(new QAction(Icons::NEXT.icon(), EditorManager::tr("Go Forward"), parent)),
m_backButton(new QToolButton(q)),
m_forwardButton(new QToolButton(q)),
m_splitButton(new QToolButton(q)),
m_horizontalSplitAction(new QAction(Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)), EditorManager::tr("Split"), parent)),
m_verticalSplitAction(new QAction(Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_SPLIT_VERTICAL)), EditorManager::tr("Split Side by Side"), parent)),
m_horizontalSplitAction(new QAction(Icons::SPLIT_HORIZONTAL.icon(), EditorManager::tr("Split"), parent)),
m_verticalSplitAction(new QAction(Icons::SPLIT_VERTICAL.icon(), EditorManager::tr("Split Side by Side"), parent)),
m_splitNewWindowAction(new QAction(EditorManager::tr("Open in New Window"), parent)),
m_closeSplitButton(new QToolButton(q)),
m_activeToolBar(0),
@@ -153,8 +152,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_editorList->setContextMenuPolicy(Qt::CustomContextMenu);
d->m_closeEditorButton->setAutoRaise(true);
d->m_closeEditorButton->setIcon(
Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_BUTTON_CLOSE)));
d->m_closeEditorButton->setIcon(Icons::BUTTON_CLOSE.icon());
d->m_closeEditorButton->setEnabled(false);
d->m_closeEditorButton->setProperty("showborder", true);
@@ -170,8 +168,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_splitNewWindowAction->setIconVisibleInMenu(false);
}
d->m_splitButton->setIcon(
Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)));
d->m_splitButton->setIcon(Icons::SPLIT_HORIZONTAL.icon());
d->m_splitButton->setToolTip(tr("Split"));
d->m_splitButton->setPopupMode(QToolButton::InstantPopup);
d->m_splitButton->setProperty("noArrow", true);
@@ -182,8 +179,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_splitButton->setMenu(splitMenu);
d->m_closeSplitButton->setAutoRaise(true);
d->m_closeSplitButton->setIcon(
Utils::ThemeHelper::themedIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_BOTTOM)));
d->m_closeSplitButton->setIcon(Icons::CLOSE_SPLIT_BOTTOM.icon());
QHBoxLayout *toplayout = new QHBoxLayout(this);
toplayout->setSpacing(0);