Todo: Use "toolbar" style icons in the toolbar

For consistency reasons (see "Debugger Console" tool bar), we should use
the *_TOOLBAR icon variants for toolbars. On the other hand, we should
use the icons without *_TOOLBAR for non-toolbar icos (todo list view
items).

Change-Id: I17e7408488112e527c166019341b570ba0f88f10
Reviewed-by: Serhii Moroz <frost.asm@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Alessandro Portale
2016-08-12 16:50:07 +02:00
parent fcff6fde73
commit 358617a06f
3 changed files with 21 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ QIcon icon(IconType type)
const static QIcon icon = const static QIcon icon =
Icon({ Icon({
{":/todoplugin/images/bugfill.png", Theme::BackgroundColorNormal}, {":/todoplugin/images/bugfill.png", Theme::BackgroundColorNormal},
{":/todoplugin/images/bug.png", Theme::IconsInterruptToolBarColor} {":/todoplugin/images/bug.png", Theme::IconsInterruptColor}
}, Icon::Tint).icon(); }, Icon::Tint).icon();
return icon; return icon;
@@ -57,7 +57,7 @@ QIcon icon(IconType type)
case IconType::Todo: { case IconType::Todo: {
const static QIcon icon = const static QIcon icon =
Icon({ Icon({
{":/todoplugin/images/tasklist.png", Theme::IconsRunToolBarColor} {":/todoplugin/images/tasklist.png", Theme::IconsRunColor}
}, Icon::Tint).icon(); }, Icon::Tint).icon();
return icon; return icon;
} }
@@ -70,5 +70,22 @@ QIcon icon(IconType type)
} }
} }
QIcon toolBarIcon(IconType type)
{
switch (type) {
case IconType::Info:
return Icons::INFO_TOOLBAR.icon();
case IconType::Warning:
return Icons::WARNING_TOOLBAR.icon();
case IconType::Bug:
return Icon({{":/todoplugin/images/bug.png", Theme::IconsInterruptToolBarColor}}).icon();
case IconType::Todo:
return Icon({{":/todoplugin/images/tasklist.png", Theme::IconsRunToolBarColor}}).icon();
default:
case IconType::Error:
return Icons::ERROR_TOOLBAR.icon();
}
}
} // namespace Internal } // namespace Internal
} // namespace Todo } // namespace Todo

View File

@@ -40,6 +40,7 @@ enum class IconType {
}; };
QIcon icon(IconType type); QIcon icon(IconType type);
QIcon toolBarIcon(IconType type);
} // namespace Internal } // namespace Internal
} // namespace Todo } // namespace Todo

View File

@@ -279,7 +279,7 @@ void TodoOutputPane::createScopeButtons()
QString tooltip = tr("Show \"%1\" entries"); QString tooltip = tr("Show \"%1\" entries");
for (const Keyword &keyword: m_settings->keywords) { for (const Keyword &keyword: m_settings->keywords) {
QToolButton *button = createCheckableToolButton(keyword.name, tooltip.arg(keyword.name), icon(keyword.iconType)); QToolButton *button = createCheckableToolButton(keyword.name, tooltip.arg(keyword.name), toolBarIcon(keyword.iconType));
button->setProperty(Constants::FILTER_KEYWORD_NAME, keyword.name); button->setProperty(Constants::FILTER_KEYWORD_NAME, keyword.name);
button->setToolButtonStyle(Qt::ToolButtonIconOnly); button->setToolButtonStyle(Qt::ToolButtonIconOnly);
connect(button, &QToolButton::clicked, this, &TodoOutputPane::updateFilter); connect(button, &QToolButton::clicked, this, &TodoOutputPane::updateFilter);