Commit 5e32183c authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Theme: Separate run/stop/interrupt icons in menus



And for that, we also need separate theme color roles.

Change-Id: I27bf4499acb516f7f824f5e57632797653b150ec
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 250c77a9
......@@ -58,9 +58,12 @@ IconsWarningToolBarColor=ffe0b716
IconsErrorColor=ffd84044
IconsErrorToolBarColor=ffd84044
IconsRunColor=ff7fc341
IconsRunToolBarColor=ff7fc341
IconsStopColor=ffe7353b
IconsDebugColor=ffb8c6ff
IconsStopToolBarColor=ffe7353b
IconsInterruptColor=ff7488db
IconsInterruptToolBarColor=ff7488db
IconsDebugColor=ffb8c6ff
IconsNavigationArrowsColor=ffebc322
IconsBuildHammerHandleColor=ffdd7710
IconsBuildHammerHeadColor=ff989898
......
......@@ -51,10 +51,13 @@ IconsWarningColor=ffecbc1c
IconsWarningToolBarColor=fff2d76e
IconsErrorColor=ffdf4f4f
IconsErrorToolBarColor=ffdb6f71
IconsRunColor=ffa4d576
IconsStopColor=ffff8c8c
IconsRunColor=ff6da838
IconsRunToolBarColor=ffa4d576
IconsStopColor=ffee6969
IconsStopToolBarColor=ffff8c8c
IconsInterruptColor=ff587ff7
IconsInterruptToolBarColor=ff8f9dda
IconsDebugColor=ffdcdcdc
IconsInterruptColor=ff8f9dda
IconsNavigationArrowsColor=ffebc322
IconsBuildHammerHandleColor=ffdd7710
IconsBuildHammerHeadColor=ff989898
......
......@@ -61,10 +61,13 @@ IconsWarningColor=ffecbc1c
IconsWarningToolBarColor=fff2d76e
IconsErrorColor=ffdf4f4f
IconsErrorToolBarColor=ffdb6f71
IconsRunColor=ff93be6c
IconsStopColor=ffe27f7f
IconsRunColor=ff6da838
IconsRunToolBarColor=ff93be6c
IconsStopColor=ffee6969
IconsStopToolBarColor=ffe27f7f
IconsInterruptColor=ff587ff7
IconsInterruptToolBarColor=ff6a7bc3
IconsDebugColor=toolBarItem
IconsInterruptColor=ff6a7bc3
IconsNavigationArrowsColor=ffebc322
IconsBuildHammerHandleColor=ffc26b14
IconsBuildHammerHeadColor=ff868687
......
......@@ -91,7 +91,7 @@ static const QIcon &icon(IconIndex icon)
case OkIcon: {
static const QIcon ok =
Icon({{QLatin1String(":/extensionsystem/images/ok.png"),
Theme::IconsRunColor}}, Icon::Tint).icon();
Theme::IconsRunToolBarColor}}, Icon::Tint).icon();
return ok;
}
case ErrorIcon: {
......
......@@ -52,7 +52,8 @@ public:
DropShadow = 2,
PunchEdges = 4,
ToolBarStyle = Tint | DropShadow | PunchEdges
ToolBarStyle = Tint | DropShadow | PunchEdges,
MenuTintedStyle = Tint | PunchEdges
};
Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption)
......
......@@ -137,8 +137,11 @@ public:
IconsErrorColor,
IconsErrorToolBarColor,
IconsRunColor,
IconsRunToolBarColor,
IconsStopColor,
IconsStopToolBarColor,
IconsInterruptColor,
IconsInterruptToolBarColor,
IconsDebugColor,
IconsNavigationArrowsColor,
IconsBuildHammerHandleColor,
......
......@@ -44,7 +44,7 @@ AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc)
, m_running(false)
{
setRunnable(m_runner->runnable());
setIcon(Core::Icons::RUN_SMALL);
setIcon(Core::Icons::RUN_SMALL_TOOLBAR);
}
AndroidRunControl::~AndroidRunControl()
......
......@@ -158,13 +158,13 @@ void TestResultsPane::createToolButtons()
});
m_runAll = new QToolButton(m_treeView);
m_runAll->setIcon(Core::Icons::RUN_SMALL.icon());
m_runAll->setIcon(Core::Icons::RUN_SMALL_TOOLBAR.icon());
m_runAll->setToolTip(tr("Run All Tests"));
m_runAll->setEnabled(false);
connect(m_runAll, &QToolButton::clicked, this, &TestResultsPane::onRunAllTriggered);
m_runSelected = new QToolButton(m_treeView);
Utils::Icon runSelectedIcon = Core::Icons::RUN_SMALL;
Utils::Icon runSelectedIcon = Core::Icons::RUN_SMALL_TOOLBAR;
foreach (const Utils::IconMaskAndColor &maskAndColor, Icons::RUN_SELECTED_OVERLAY)
runSelectedIcon.append(maskAndColor);
m_runSelected->setIcon(runSelectedIcon.icon());
......@@ -173,7 +173,7 @@ void TestResultsPane::createToolButtons()
connect(m_runSelected, &QToolButton::clicked, this, &TestResultsPane::onRunSelectedTriggered);
m_stopTestRun = new QToolButton(m_treeView);
m_stopTestRun->setIcon(Core::Icons::STOP_SMALL.icon());
m_stopTestRun->setIcon(Core::Icons::STOP_SMALL_TOOLBAR.icon());
m_stopTestRun->setToolTip(tr("Stop Test Run"));
m_stopTestRun->setEnabled(false);
connect(m_stopTestRun, &QToolButton::clicked, TestRunner::instance(), &TestRunner::requestStopTestRun);
......
......@@ -123,7 +123,7 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
// Go to previous diagnostic
auto action = new QAction(this);
action->setDisabled(true);
action->setIcon(Core::Icons::PREV.icon());
action->setIcon(Core::Icons::PREV_TOOLBAR.icon());
action->setToolTip(tr("Go to previous bug."));
connect(action, &QAction::triggered, m_diagnosticView, &DetailedErrorView::goBack);
m_goBack = action;
......@@ -131,7 +131,7 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
// Go to next diagnostic
action = new QAction(this);
action->setDisabled(true);
action->setIcon(Core::Icons::NEXT.icon());
action->setIcon(Core::Icons::NEXT_TOOLBAR.icon());
action->setToolTip(tr("Go to next bug."));
connect(action, &QAction::triggered, m_diagnosticView, &DetailedErrorView::goNext);
m_goNext = action;
......
......@@ -84,8 +84,12 @@ const Icon MINUS({
const Icon PLUS({
{QLatin1String(":/core/images/plus.png"), Theme::IconsBaseColor}});
const Icon NEXT({
{QLatin1String(":/core/images/next.png"), Theme::IconsWarningColor}}, Icon::MenuTintedStyle);
const Icon NEXT_TOOLBAR({
{QLatin1String(":/core/images/next.png"), Theme::IconsNavigationArrowsColor}});
const Icon PREV({
{QLatin1String(":/core/images/prev.png"), Theme::IconsWarningColor}}, Icon::MenuTintedStyle);
const Icon PREV_TOOLBAR({
{QLatin1String(":/core/images/prev.png"), Theme::IconsNavigationArrowsColor}});
const Icon MAGNIFIER({
{QLatin1String(":/core/images/magnifier.png"), Theme::PanelTextColorMid}}, Icon::Tint);
......@@ -94,6 +98,8 @@ const Icon CLEAN_PANE({
const Icon RELOAD({
{QLatin1String(":/core/images/reload_gray.png"), Theme::IconsBaseColor}});
const Icon TOGGLE_SIDEBAR({
{QLatin1String(":/core/images/sidebaricon.png"), Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
const Icon TOGGLE_SIDEBAR_TOOLBAR({
{QLatin1String(":/core/images/sidebaricon.png"), Theme::IconsBaseColor}});
const Icon CLOSE_TOOLBAR({
{QLatin1String(":/core/images/close.png"), Theme::IconsBaseColor}});
......@@ -102,8 +108,12 @@ const Icon CLOSE_FOREGROUND({
const Icon CLOSE_BACKGROUND({
{QLatin1String(":/core/images/close.png"), Theme::PanelTextColorLight}}, Icon::Tint);
const Icon SPLIT_HORIZONTAL({
{QLatin1String(":/core/images/splitbutton_horizontal.png"), Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
const Icon SPLIT_HORIZONTAL_TOOLBAR({
{QLatin1String(":/core/images/splitbutton_horizontal.png"), Theme::IconsBaseColor}});
const Icon SPLIT_VERTICAL({
{QLatin1String(":/core/images/splitbutton_vertical.png"), Theme::PanelTextColorMid}}, Icon::MenuTintedStyle);
const Icon SPLIT_VERTICAL_TOOLBAR({
{QLatin1String(":/core/images/splitbutton_vertical.png"), Theme::IconsBaseColor}});
const Icon CLOSE_SPLIT_TOP({
{QLatin1String(":/core/images/splitbutton_closetop.png"), Theme::IconsBaseColor}});
......@@ -143,11 +153,17 @@ const Icon ZOOM_TOOLBAR({
const Icon TOOLBAR_EXTENSION({
{QLatin1String(":/core/images/extension.png"), Theme::IconsBaseColor}});
const Utils::Icon RUN_SMALL({
{QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}});
{QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon RUN_SMALL_TOOLBAR({
{QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunToolBarColor}});
const Utils::Icon STOP_SMALL({
{QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}});
{QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon STOP_SMALL_TOOLBAR({
{QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopToolBarColor}});
const Utils::Icon INTERRUPT_SMALL({
{QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}});
{QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon INTERRUPT_SMALL_TOOLBAR({
{QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptToolBarColor}});
const Icon BOUNDING_RECT({
{QLatin1String(":/core/images/boundingrect.png"), Theme::IconsBaseColor}});
const Icon EYE_OPEN_TOOLBAR({
......
......@@ -61,16 +61,21 @@ CORE_EXPORT extern const Utils::Icon ARROW_DOWN;
CORE_EXPORT extern const Utils::Icon MINUS;
CORE_EXPORT extern const Utils::Icon PLUS;
CORE_EXPORT extern const Utils::Icon NEXT;
CORE_EXPORT extern const Utils::Icon NEXT_TOOLBAR;
CORE_EXPORT extern const Utils::Icon PREV;
CORE_EXPORT extern const Utils::Icon PREV_TOOLBAR;
CORE_EXPORT extern const Utils::Icon MAGNIFIER;
CORE_EXPORT extern const Utils::Icon CLEAN_PANE;
CORE_EXPORT extern const Utils::Icon RELOAD;
CORE_EXPORT extern const Utils::Icon TOGGLE_SIDEBAR;
CORE_EXPORT extern const Utils::Icon TOGGLE_SIDEBAR_TOOLBAR;
CORE_EXPORT extern const Utils::Icon CLOSE_TOOLBAR;
CORE_EXPORT extern const Utils::Icon CLOSE_FOREGROUND;
CORE_EXPORT extern const Utils::Icon CLOSE_BACKGROUND;
CORE_EXPORT extern const Utils::Icon SPLIT_HORIZONTAL;
CORE_EXPORT extern const Utils::Icon SPLIT_HORIZONTAL_TOOLBAR;
CORE_EXPORT extern const Utils::Icon SPLIT_VERTICAL;
CORE_EXPORT extern const Utils::Icon SPLIT_VERTICAL_TOOLBAR;
CORE_EXPORT extern const Utils::Icon CLOSE_SPLIT_TOP;
CORE_EXPORT extern const Utils::Icon CLOSE_SPLIT_BOTTOM;
CORE_EXPORT extern const Utils::Icon CLOSE_SPLIT_LEFT;
......@@ -89,8 +94,11 @@ CORE_EXPORT extern const Utils::Icon ZOOM;
CORE_EXPORT extern const Utils::Icon ZOOM_TOOLBAR;
CORE_EXPORT extern const Utils::Icon TOOLBAR_EXTENSION;
CORE_EXPORT extern const Utils::Icon RUN_SMALL;
CORE_EXPORT extern const Utils::Icon RUN_SMALL_TOOLBAR;
CORE_EXPORT extern const Utils::Icon STOP_SMALL;
CORE_EXPORT extern const Utils::Icon STOP_SMALL_TOOLBAR;
CORE_EXPORT extern const Utils::Icon INTERRUPT_SMALL;
CORE_EXPORT extern const Utils::Icon INTERRUPT_SMALL_TOOLBAR;
CORE_EXPORT extern const Utils::Icon BOUNDING_RECT;
CORE_EXPORT extern const Utils::Icon EYE_OPEN_TOOLBAR;
CORE_EXPORT extern const Utils::Icon EYE_CLOSED_TOOLBAR;
......
......@@ -208,8 +208,8 @@ EditorManagerPrivate::EditorManagerPrivate(QObject *parent) :
m_closeAllEditorsExceptVisibleAction(new QAction(EditorManager::tr("Close All Except Visible"), this)),
m_gotoNextDocHistoryAction(new QAction(EditorManager::tr("Next Open Document in History"), this)),
m_gotoPreviousDocHistoryAction(new QAction(EditorManager::tr("Previous Open Document in History"), this)),
m_goBackAction(new QAction(Icons::PREV.icon(), EditorManager::tr("Go Back"), this)),
m_goForwardAction(new QAction(Icons::NEXT.icon(), EditorManager::tr("Go Forward"), this)),
m_goBackAction(new QAction(Icons::PREV_TOOLBAR.icon(), EditorManager::tr("Go Back"), this)),
m_goForwardAction(new QAction(Icons::NEXT_TOOLBAR.icon(), EditorManager::tr("Go Forward"), this)),
m_copyFilePathContextAction(new QAction(EditorManager::tr("Copy Full Path"), this)),
m_copyLocationContextAction(new QAction(EditorManager::tr("Copy Path and Line Number"), this)),
m_copyFileNameContextAction(new QAction(EditorManager::tr("Copy File Name"), this)),
......
......@@ -94,13 +94,13 @@ EditorToolBarPrivate::EditorToolBarPrivate(QWidget *parent, EditorToolBar *q) :
m_lockButton(new QToolButton(q)),
m_dragHandle(new QToolButton(q)),
m_dragHandleMenu(0),
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_goBackAction(new QAction(Icons::PREV_TOOLBAR.icon(), EditorManager::tr("Go Back"), parent)),
m_goForwardAction(new QAction(Icons::NEXT_TOOLBAR.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(Icons::SPLIT_HORIZONTAL.icon(), EditorManager::tr("Split"), parent)),
m_verticalSplitAction(new QAction(Icons::SPLIT_VERTICAL.icon(), EditorManager::tr("Split Side by Side"), parent)),
m_horizontalSplitAction(new QAction(Icons::SPLIT_HORIZONTAL_TOOLBAR.icon(), EditorManager::tr("Split"), parent)),
m_verticalSplitAction(new QAction(Icons::SPLIT_VERTICAL_TOOLBAR.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),
......@@ -163,7 +163,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_splitNewWindowAction->setIconVisibleInMenu(false);
}
d->m_splitButton->setIcon(Icons::SPLIT_HORIZONTAL.icon());
d->m_splitButton->setIcon(Icons::SPLIT_HORIZONTAL_TOOLBAR.icon());
d->m_splitButton->setToolTip(tr("Split"));
d->m_splitButton->setPopupMode(QToolButton::InstantPopup);
d->m_splitButton->setProperty("noArrow", true);
......
......@@ -963,9 +963,9 @@ void FindToolBar::setLightColoredIcon(bool lightColored)
m_ui.findPreviousButton->setArrowType(Qt::LeftArrow);
m_ui.close->setIcon(Icons::CLOSE_FOREGROUND.icon());
} else {
m_ui.findNextButton->setIcon(Icons::NEXT.icon());
m_ui.findNextButton->setIcon(Icons::NEXT_TOOLBAR.icon());
m_ui.findNextButton->setArrowType(Qt::NoArrow);
m_ui.findPreviousButton->setIcon(Icons::PREV.icon());
m_ui.findPreviousButton->setIcon(Icons::PREV_TOOLBAR.icon());
m_ui.findPreviousButton->setArrowType(Qt::NoArrow);
m_ui.close->setIcon(Icons::CLOSE_TOOLBAR.icon());
}
......
......@@ -27,9 +27,8 @@
#include "locatorfiltersfilter.h"
#include "locatorwidget.h"
#include <utils/icon.h>
#include <coreplugin/coreicons.h>
#include <utils/qtcassert.h>
#include <utils/theme/theme.h>
using namespace Core;
using namespace Core::Internal;
......@@ -40,8 +39,7 @@ LocatorFiltersFilter::LocatorFiltersFilter(Locator *plugin,
LocatorWidget *locatorWidget):
m_plugin(plugin),
m_locatorWidget(locatorWidget),
m_icon(Utils::Icon({{QLatin1String(":/core/images/next.png"), Utils::Theme::IconsWarningColor}},
Utils::Icon::Tint).pixmap())
m_icon(Icons::NEXT.icon())
{
setId("FiltersFilter");
setDisplayName(tr("Available filters"));
......
......@@ -691,7 +691,7 @@ void MainWindow::registerDefaultActions()
}
// Show Sidebar Action
m_toggleSideBarAction = new QAction(Icons::TOGGLE_SIDEBAR.icon(),
m_toggleSideBarAction = new QAction(Icons::TOGGLE_SIDEBAR_TOOLBAR.icon(),
QCoreApplication::translate("Core", Constants::TR_SHOW_SIDEBAR),
this);
m_toggleSideBarAction->setCheckable(true);
......
......@@ -69,7 +69,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
toolBarLayout->addWidget(m_navigationComboBox);
QToolButton *splitAction = new QToolButton();
splitAction->setIcon(Icons::SPLIT_HORIZONTAL.icon());
splitAction->setIcon(Icons::SPLIT_HORIZONTAL_TOOLBAR.icon());
splitAction->setToolTip(tr("Split"));
splitAction->setPopupMode(QToolButton::InstantPopup);
splitAction->setProperty("noArrow", true);
......
......@@ -145,12 +145,12 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
connect(m_clearAction, &QAction::triggered, this, &OutputPaneManager::clearPage);
m_nextAction = new QAction(this);
m_nextAction->setIcon(Icons::NEXT.icon());
m_nextAction->setIcon(Icons::NEXT_TOOLBAR.icon());
m_nextAction->setText(tr("Next Item"));
connect(m_nextAction, &QAction::triggered, this, &OutputPaneManager::slotNext);
m_prevAction = new QAction(this);
m_prevAction->setIcon(Icons::PREV.icon());
m_prevAction->setIcon(Icons::PREV_TOOLBAR.icon());
m_prevAction->setText(tr("Previous Item"));
connect(m_prevAction, &QAction::triggered, this, &OutputPaneManager::slotPrev);
......
......@@ -72,7 +72,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
m_splitAction = new QAction(tr("Split"), m_toolbar);
m_splitAction->setToolTip(tr("Split"));
m_splitAction->setIcon(Icons::SPLIT_HORIZONTAL.icon());
m_splitAction->setIcon(Icons::SPLIT_HORIZONTAL_TOOLBAR.icon());
connect(m_splitAction, &QAction::triggered, this, &SideBarWidget::splitMe);
m_toolbar->addAction(m_splitAction);
......
......@@ -32,7 +32,7 @@ namespace Debugger {
namespace Icons {
const Utils::Icon ANALYZER_CONTROL_START({
{QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor},
{QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunToolBarColor},
{QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon MODE_ANALYZE_CLASSIC(
QLatin1String(":/images/mode_analyze.png"));
......
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