AutoTest: Use separate icon variations for toolbar and menu

For the "Run" and "Run failed" actions.

Change-Id: I7fc537cbe0727038740f2c26478c30dc96babb66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2020-12-04 14:29:20 +01:00
parent 19e13ddd6b
commit 8df758c45e
3 changed files with 17 additions and 9 deletions

View File

@@ -33,8 +33,13 @@ namespace Icons {
const Utils::Icon SORT_NATURALLY({ const Utils::Icon SORT_NATURALLY({
{":/autotest/images/leafsort.png", Utils::Theme::IconsBaseColor}}); {":/autotest/images/leafsort.png", Utils::Theme::IconsBaseColor}});
const Utils::Icon RUN_FAILED_OVERLAY({ const Utils::Icon RUN_FAILED({
{":utils/images/iconoverlay_reset.png", Utils::Theme::OutputPanes_TestXPassTextColor}}); {":/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({ const Utils::Icon RESULT_PASS({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor}}, {":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor}},
Utils::Icon::Tint); Utils::Icon::Tint);

View File

@@ -204,7 +204,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
menu->setOnAllDisabledBehavior(ActionContainer::Show); menu->setOnAllDisabledBehavior(ActionContainer::Show);
QAction *action = new QAction(tr("Run &All Tests"), this); 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")); action->setToolTip(tr("Run All Tests"));
Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID); Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID);
command->setDefaultKeySequence( command->setDefaultKeySequence(
@@ -224,10 +224,7 @@ void AutotestPluginPrivate::initializeMenuEntries()
menu->addAction(command); menu->addAction(command);
action = new QAction(tr("Run &Failed Tests"), this); action = new QAction(tr("Run &Failed Tests"), this);
Utils::Icon runFailedIcon = Utils::Icons::RUN_SMALL_TOOLBAR; action->setIcon(Icons::RUN_FAILED.icon());
for (const Utils::IconMaskAndColor &maskAndColor: Icons::RUN_FAILED_OVERLAY)
runFailedIcon.append(maskAndColor);
action->setIcon(runFailedIcon.icon());
action->setToolTip(tr("Run Failed Tests")); action->setToolTip(tr("Run Failed Tests"));
command = ActionManager::registerAction(action, Constants::ACTION_RUN_FAILED_ID); command = ActionManager::registerAction(action, Constants::ACTION_RUN_FAILED_ID);
command->setDefaultKeySequence( command->setDefaultKeySequence(

View File

@@ -182,7 +182,10 @@ void TestResultsPane::createToolButtons()
}); });
m_runAll = new QToolButton(m_treeView); 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 = new QToolButton(m_treeView);
m_runSelected->setDefaultAction( m_runSelected->setDefaultAction(
@@ -191,7 +194,10 @@ void TestResultsPane::createToolButtons()
Utils::Icons::RUN_SELECTED_TOOLBAR.icon())); Utils::Icons::RUN_SELECTED_TOOLBAR.icon()));
m_runFailed = new QToolButton(m_treeView); 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 = new QToolButton(m_treeView);
m_runFile->setDefaultAction( m_runFile->setDefaultAction(
Utils::ProxyAction::proxyActionWithIcon( Utils::ProxyAction::proxyActionWithIcon(