diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp index 3fa626551b8..88c7ed225a3 100644 --- a/src/libs/utils/utilsicons.cpp +++ b/src/libs/utils/utilsicons.cpp @@ -265,6 +265,20 @@ const Icon OVERLAY_WARNING({ const Icon OVERLAY_ERROR({ {":/utils/images/iconoverlay_error_background.png", Theme::BackgroundColorNormal}, {":/utils/images/iconoverlay_error.png", Theme::IconsErrorColor}}, Icon::Tint); +const Icon RUN_FILE({ + {":/utils/images/run_small.png", Theme::IconsRunColor}, + {":/utils/images/run_file.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon RUN_FILE_TOOLBAR({ + {":/utils/images/run_small.png", Theme::IconsRunToolBarColor}, + {":/utils/images/run_file.png", Theme::IconsBaseColor}}); +const Icon RUN_SELECTED({ + {":/utils/images/run_small.png", Theme::IconsRunColor}, + {":/utils/images/runselected_boxes.png", Theme::PanelTextColorMid}, + {":/utils/images/runselected_tickmarks.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon RUN_SELECTED_TOOLBAR({ + {":/utils/images/run_small.png", Theme::IconsRunToolBarColor}, + {":/utils/images/runselected_boxes.png", Theme::IconsBaseColor}, + {":/utils/images/runselected_tickmarks.png", Theme::IconsBaseColor}}); const Icon CODEMODEL_ERROR({ {":/utils/images/codemodelerror.png", Theme::IconsErrorColor}}, Icon::Tint); diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h index 0f7c9d654b5..6f955cd1a37 100644 --- a/src/libs/utils/utilsicons.h +++ b/src/libs/utils/utilsicons.h @@ -149,6 +149,10 @@ QTCREATOR_UTILS_EXPORT extern const Icon EMPTY16; QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_ADD; QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_WARNING; QTCREATOR_UTILS_EXPORT extern const Icon OVERLAY_ERROR; +QTCREATOR_UTILS_EXPORT extern const Icon RUN_FILE; +QTCREATOR_UTILS_EXPORT extern const Icon RUN_FILE_TOOLBAR; +QTCREATOR_UTILS_EXPORT extern const Icon RUN_SELECTED; +QTCREATOR_UTILS_EXPORT extern const Icon RUN_SELECTED_TOOLBAR; QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_ERROR; QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_WARNING; diff --git a/src/plugins/autotest/autotesticons.h b/src/plugins/autotest/autotesticons.h index ab96f631fc1..2b4b62153eb 100644 --- a/src/plugins/autotest/autotesticons.h +++ b/src/plugins/autotest/autotesticons.h @@ -33,13 +33,8 @@ namespace Icons { const Utils::Icon SORT_NATURALLY({ {":/autotest/images/leafsort.png", Utils::Theme::IconsBaseColor}}); -const Utils::Icon RUN_SELECTED_OVERLAY({ - {":/utils/images/runselected_boxes.png", Utils::Theme::BackgroundColorDark}, - {":/utils/images/runselected_tickmarks.png", Utils::Theme::IconsBaseColor}}); const Utils::Icon RUN_FAILED_OVERLAY({ {":utils/images/iconoverlay_reset.png", Utils::Theme::OutputPanes_TestXPassTextColor}}); -const Utils::Icon RUN_FILE_OVERLAY({ - {":/utils/images/run_file.png", Utils::Theme::IconsBaseColor}}); const Utils::Icon RESULT_PASS({ {":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor}}, Utils::Icon::Tint); diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index d77861efda3..7fd106ac174 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -214,10 +214,7 @@ void AutotestPluginPrivate::initializeMenuEntries() menu->addAction(command); action = new QAction(tr("&Run Selected Tests"), this); - Utils::Icon runSelectedIcon = Utils::Icons::RUN_SMALL_TOOLBAR; - for (const Utils::IconMaskAndColor &maskAndColor : Icons::RUN_SELECTED_OVERLAY) - runSelectedIcon.append(maskAndColor); - action->setIcon(runSelectedIcon.icon()); + action->setIcon(Utils::Icons::RUN_SELECTED.icon()); action->setToolTip(tr("Run Selected Tests")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_SELECTED_ID); command->setDefaultKeySequence( @@ -240,10 +237,7 @@ void AutotestPluginPrivate::initializeMenuEntries() menu->addAction(command); action = new QAction(tr("Run Tests for &Current File"), this); - Utils::Icon runFileIcon = Utils::Icons::RUN_SMALL_TOOLBAR; - for (const Utils::IconMaskAndColor &maskAndColor : Icons::RUN_FILE_OVERLAY) - runFileIcon.append(maskAndColor); - action->setIcon(runFileIcon.icon()); + action->setIcon(Utils::Icons::RUN_FILE.icon()); action->setToolTip(tr("Run Tests for Current File")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_FILE_ID); command->setDefaultKeySequence( diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 5cbe20e0708..e92e381c168 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -184,12 +185,18 @@ void TestResultsPane::createToolButtons() m_runAll->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()); m_runSelected = new QToolButton(m_treeView); - m_runSelected->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()); + m_runSelected->setDefaultAction( + Utils::ProxyAction::proxyActionWithIcon( + ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action(), + Utils::Icons::RUN_SELECTED_TOOLBAR.icon())); m_runFailed = new QToolButton(m_treeView); m_runFailed->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_FAILED_ID)->action()); m_runFile = new QToolButton(m_treeView); - m_runFile->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_FILE_ID)->action()); + m_runFile->setDefaultAction( + Utils::ProxyAction::proxyActionWithIcon( + ActionManager::command(Constants::ACTION_RUN_FILE_ID)->action(), + Utils::Icons::RUN_FILE_TOOLBAR.icon())); m_stopTestRun = new QToolButton(m_treeView); m_stopTestRun->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon()); diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 7f07b720c90..882e3092a97 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -66,7 +66,6 @@ #include #include #include -#include #include #include @@ -385,23 +384,12 @@ ClangTool::ClangTool() s_instance = this; m_diagnosticModel = new ClangToolsDiagnosticModel(this); - const Utils::Icon RUN_SELECTED_OVERLAY( - {{":/utils/images/runselected_boxes.png", Utils::Theme::BackgroundColorDark}, - {":/utils/images/runselected_tickmarks.png", Utils::Theme::IconsBaseColor}}); - auto action = new QAction(tr("Analyze Project..."), this); - Utils::Icon runSelectedIcon = Utils::Icons::RUN_SMALL_TOOLBAR; - for (const Utils::IconMaskAndColor &maskAndColor : RUN_SELECTED_OVERLAY) - runSelectedIcon.append(maskAndColor); - action->setIcon(runSelectedIcon.icon()); + action->setIcon(Utils::Icons::RUN_SELECTED_TOOLBAR.icon()); m_startAction = action; action = new QAction(tr("Analyze Current File"), this); - const QIcon runFileIcon = Icon( - {{":/utils/images/run_small.png", Theme::IconsRunColor}, - {":/utils/images/run_file.png", Theme::PanelTextColorMid}}, - Icon::MenuTintedStyle).icon(); - action->setIcon(runFileIcon); + action->setIcon(Utils::Icons::RUN_FILE.icon()); m_startOnCurrentFileAction = action; m_stopAction = Debugger::createStopAction(); @@ -581,13 +569,10 @@ ClangTool::ClangTool() startTool(FileSelectionType::CurrentFile); }); - const QIcon runFileIconToolBar = Icon( - {{":/utils/images/run_small.png", Theme::IconsRunToolBarColor}, - {":/utils/images/run_file.png", Theme::IconsBaseColor}}).icon(); - m_perspective.addToolBarAction(m_startAction); m_perspective.addToolBarAction(ProxyAction::proxyActionWithIcon( - m_startOnCurrentFileAction, runFileIconToolBar)); + m_startOnCurrentFileAction, + Utils::Icons::RUN_FILE_TOOLBAR.icon())); m_perspective.addToolBarAction(m_stopAction); m_perspective.addToolBarAction(m_openProjectSettings); m_perspective.addToolbarSeparator();