Commit 9ebaf79b authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau Committed by Christoph Cullmann
Browse files

Prefer data-error/warning/information icons over dialog-* for line marker

Icons are part of Breeze/Oxygen icons >= 5.68
parent 6c38dd65
......@@ -69,16 +69,19 @@ static const QString NinjaPrefix = QStringLiteral("[ninja]");
static QIcon messageIcon(KateBuildView::ErrorCategory severity)
{
#define RETURN_CACHED_ICON(name) \
{ \
static QIcon icon(QIcon::fromTheme(QStringLiteral(name))); \
return icon; \
// clang-format off
#define RETURN_CACHED_ICON(name, fallbackname) \
{ \
static QIcon icon(QIcon::fromTheme(QStringLiteral(name), \
QIcon::fromTheme(QStringLiteral(fallbackname)))); \
return icon; \
}
// clang-format on
switch (severity) {
case KateBuildView::CategoryError:
RETURN_CACHED_ICON("dialog-error")
RETURN_CACHED_ICON("data-error", "dialog-error")
case KateBuildView::CategoryWarning:
RETURN_CACHED_ICON("dialog-warning")
RETURN_CACHED_ICON("data-warning", "dialog-warning")
default:
break;
}
......
......@@ -125,20 +125,21 @@ static constexpr KTextEditor::MarkInterface::MarkTypes markTypeDiagAll = KTextEd
static QIcon diagnosticsIcon(LSPDiagnosticSeverity severity)
{
// clang-format off
#define RETURN_CACHED_ICON(name) \
#define RETURN_CACHED_ICON(name, fallbackname) \
{ \
static QIcon icon(QIcon::fromTheme(QStringLiteral(name))); \
static QIcon icon(QIcon::fromTheme(QStringLiteral(name), \
QIcon::fromTheme(QStringLiteral(fallbackname)))); \
return icon; \
}
// clang-format on
switch (severity) {
case LSPDiagnosticSeverity::Error:
RETURN_CACHED_ICON("dialog-error")
RETURN_CACHED_ICON("data-error", "dialog-error")
case LSPDiagnosticSeverity::Warning:
RETURN_CACHED_ICON("dialog-warning")
RETURN_CACHED_ICON("data-warning", "dialog-warning")
case LSPDiagnosticSeverity::Information:
case LSPDiagnosticSeverity::Hint:
RETURN_CACHED_ICON("dialog-information")
RETURN_CACHED_ICON("data-information", "dialog-information")
default:
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment