forked from qt-creator/qt-creator
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:
@@ -49,7 +49,7 @@ QIcon icon(IconType type)
|
||||
const static QIcon icon =
|
||||
Icon({
|
||||
{":/todoplugin/images/bugfill.png", Theme::BackgroundColorNormal},
|
||||
{":/todoplugin/images/bug.png", Theme::IconsInterruptToolBarColor}
|
||||
{":/todoplugin/images/bug.png", Theme::IconsInterruptColor}
|
||||
}, Icon::Tint).icon();
|
||||
|
||||
return icon;
|
||||
@@ -57,7 +57,7 @@ QIcon icon(IconType type)
|
||||
case IconType::Todo: {
|
||||
const static QIcon icon =
|
||||
Icon({
|
||||
{":/todoplugin/images/tasklist.png", Theme::IconsRunToolBarColor}
|
||||
{":/todoplugin/images/tasklist.png", Theme::IconsRunColor}
|
||||
}, Icon::Tint).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 Todo
|
||||
|
||||
@@ -40,6 +40,7 @@ enum class IconType {
|
||||
};
|
||||
|
||||
QIcon icon(IconType type);
|
||||
QIcon toolBarIcon(IconType type);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Todo
|
||||
|
||||
@@ -279,7 +279,7 @@ void TodoOutputPane::createScopeButtons()
|
||||
|
||||
QString tooltip = tr("Show \"%1\" entries");
|
||||
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->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
connect(button, &QToolButton::clicked, this, &TodoOutputPane::updateFilter);
|
||||
|
||||
Reference in New Issue
Block a user