From 8df758c45e1d9a5d51a727caef9f2059dd4294db Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 4 Dec 2020 14:29:20 +0100 Subject: [PATCH] AutoTest: Use separate icon variations for toolbar and menu For the "Run" and "Run failed" actions. Change-Id: I7fc537cbe0727038740f2c26478c30dc96babb66 Reviewed-by: Christian Stenger --- src/plugins/autotest/autotesticons.h | 9 +++++++-- src/plugins/autotest/autotestplugin.cpp | 7 ++----- src/plugins/autotest/testresultspane.cpp | 10 ++++++++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/plugins/autotest/autotesticons.h b/src/plugins/autotest/autotesticons.h index 2b4b62153eb..69c9e5d6874 100644 --- a/src/plugins/autotest/autotesticons.h +++ b/src/plugins/autotest/autotesticons.h @@ -33,8 +33,13 @@ namespace Icons { const Utils::Icon SORT_NATURALLY({ {":/autotest/images/leafsort.png", Utils::Theme::IconsBaseColor}}); -const Utils::Icon RUN_FAILED_OVERLAY({ - {":utils/images/iconoverlay_reset.png", Utils::Theme::OutputPanes_TestXPassTextColor}}); +const Utils::Icon RUN_FAILED({ + {":/utils/images/run_small.png", Utils::Theme::IconsRunColor}, + {":/utils/images/iconoverlay_reset.png", Utils::Theme::IconsStopColor}}, + Utils::Icon::MenuTintedStyle); +const Utils::Icon RUN_FAILED_TOOLBAR({ + {":/utils/images/run_small.png", Utils::Theme::IconsRunToolBarColor}, + {":/utils/images/iconoverlay_reset.png", Utils::Theme::IconsStopToolBarColor}}); 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 7fd106ac174..2c0e5fe3b06 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -204,7 +204,7 @@ void AutotestPluginPrivate::initializeMenuEntries() menu->setOnAllDisabledBehavior(ActionContainer::Show); QAction *action = new QAction(tr("Run &All Tests"), this); - action->setIcon(Utils::Icons::RUN_SMALL_TOOLBAR.icon()); + action->setIcon(Utils::Icons::RUN_SMALL.icon()); action->setToolTip(tr("Run All Tests")); Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID); command->setDefaultKeySequence( @@ -224,10 +224,7 @@ void AutotestPluginPrivate::initializeMenuEntries() menu->addAction(command); action = new QAction(tr("Run &Failed Tests"), this); - Utils::Icon runFailedIcon = Utils::Icons::RUN_SMALL_TOOLBAR; - for (const Utils::IconMaskAndColor &maskAndColor: Icons::RUN_FAILED_OVERLAY) - runFailedIcon.append(maskAndColor); - action->setIcon(runFailedIcon.icon()); + action->setIcon(Icons::RUN_FAILED.icon()); action->setToolTip(tr("Run Failed Tests")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_FAILED_ID); command->setDefaultKeySequence( diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index e92e381c168..de3fb8ca7c1 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -182,7 +182,10 @@ void TestResultsPane::createToolButtons() }); m_runAll = new QToolButton(m_treeView); - m_runAll->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()); + m_runAll->setDefaultAction( + Utils::ProxyAction::proxyActionWithIcon( + ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action(), + Utils::Icons::RUN_SMALL_TOOLBAR.icon())); m_runSelected = new QToolButton(m_treeView); m_runSelected->setDefaultAction( @@ -191,7 +194,10 @@ void TestResultsPane::createToolButtons() Utils::Icons::RUN_SELECTED_TOOLBAR.icon())); m_runFailed = new QToolButton(m_treeView); - m_runFailed->setDefaultAction(ActionManager::command(Constants::ACTION_RUN_FAILED_ID)->action()); + m_runFailed->setDefaultAction( + Utils::ProxyAction::proxyActionWithIcon( + ActionManager::command(Constants::ACTION_RUN_FAILED_ID)->action(), + Icons::RUN_FAILED_TOOLBAR.icon())); m_runFile = new QToolButton(m_treeView); m_runFile->setDefaultAction( Utils::ProxyAction::proxyActionWithIcon(