diff --git a/share/qtcreator/themes/2024.tokenmapping b/share/qtcreator/themes/2024.tokenmapping index 3c7636e3234..ab1d4a9ba7b 100644 --- a/share/qtcreator/themes/2024.tokenmapping +++ b/share/qtcreator/themes/2024.tokenmapping @@ -11,6 +11,7 @@ BadgeLabelTextColorChecked=Token_Text_Default BadgeLabelTextColorUnchecked=Token_Text_Default CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info ComboBoxTextColor=Token_Text_Muted DockWidgetResizeHandleColor=Token_Stroke_Subtle EditorPlaceholderColor=Token_Background_Muted diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index c5834e3e104..e12a4d893c3 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -16,6 +16,7 @@ normalBackground=ff333333 alternateBackground=ff515151 error=ffd84044 warning=ffe0b716 +info=ff1f75cc splitterColor=ff313131 textColorLink=ff8ab4f8 textColorLinkVisited=ffc58af9 @@ -406,6 +407,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info PaletteWindow=normalBackground PaletteWindowText=text diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index 28200acfd7a..f822eaa287a 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -10,6 +10,7 @@ textDisabled=88a0a0a0 toolBarItem=ffdcdcdc error=ffdf4f4f warning=ffecbc1c +info=ff4f8fff shadowBackground=ff232323 splitterColor=ff151515 qmlDesignerButtonColor=ff4c4e50 @@ -399,6 +400,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info QmlDesigner_BackgroundColor=qmlDesignerButtonColor QmlDesigner_HighlightColor=ff46a2da diff --git a/share/qtcreator/themes/design-light.creatortheme b/share/qtcreator/themes/design-light.creatortheme index 2b741ddc061..c1ea7e6fb57 100644 --- a/share/qtcreator/themes/design-light.creatortheme +++ b/share/qtcreator/themes/design-light.creatortheme @@ -20,6 +20,7 @@ stop_error=ffec7373 run_success=ff52c23b error=ffdf4f4f warning=ffecbc1c +info=ff4f9df8 splitter=ffbdbebf qmlDesignerButtonColor=fff8f8f8 textColorLink=ff007af4 @@ -410,6 +411,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info ;new colors QmlDesigner_BackgroundColor=qmlDesignerButtonColor diff --git a/share/qtcreator/themes/design.creatortheme b/share/qtcreator/themes/design.creatortheme index 6b438645bd3..eae2107700e 100644 --- a/share/qtcreator/themes/design.creatortheme +++ b/share/qtcreator/themes/design.creatortheme @@ -19,6 +19,7 @@ normalBackground=ff262728 alternateBackground=ff353637 error=ffdf4f4f warning=ffecbc1c +info=ff4f8fff splitter=ff474747 textColorLink=ff007af4 textColorLinkVisited=ffa57aff @@ -414,6 +415,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info ;Designer Main colors diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index 3a6e8fa6b05..100a5e8c74c 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -20,6 +20,7 @@ normalBackground=ff2E2F30 alternateBackground=ff353637 error=ffdf4f4f warning=ffecbc1c +info=ff4f8fff splitter=ff06080A textColorLink=ff007af4 textColorLinkVisited=ffa57aff @@ -410,6 +411,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info QmlDesigner_BackgroundColor=qmlDesignerButtonColor QmlDesigner_HighlightColor=ff1d545c diff --git a/share/qtcreator/themes/flat-light.creatortheme b/share/qtcreator/themes/flat-light.creatortheme index df98e8b31e5..7d39156e23a 100644 --- a/share/qtcreator/themes/flat-light.creatortheme +++ b/share/qtcreator/themes/flat-light.creatortheme @@ -20,6 +20,7 @@ run_success=ff52c23b splitter=ffbdbebf error=ffdf4f4f warning=ffecbc1c +info=ff4f8df0 textColorLink=PaletteLink textColorLinkVisited=PaletteLinkVisited backgroundColorDisabled=PaletteWindowDisabled @@ -410,6 +411,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info QmlDesigner_BackgroundColor=qmlDesignerButtonColor QmlDesigner_HighlightColor=ff46a2da diff --git a/share/qtcreator/themes/flat.creatortheme b/share/qtcreator/themes/flat.creatortheme index 4b89f096101..9e9d14e7fd0 100644 --- a/share/qtcreator/themes/flat.creatortheme +++ b/share/qtcreator/themes/flat.creatortheme @@ -17,6 +17,7 @@ normalBackground=PaletteWindow alternateBackground=PaletteAlternateBase error=ffdf4f4f warning=ffecbc1c +info=ff4f83f1 splitter=ff313131 textColorLink=PaletteLink textColorLinkVisited=PaletteLinkVisited @@ -407,6 +408,7 @@ ProjectExplorer_TaskWarn_TextMarkColor=warning CodeModel_Error_TextMarkColor=error CodeModel_Warning_TextMarkColor=warning +CodeModel_Info_TextMarkColor=info QmlDesigner_BackgroundColor=qmlDesignerButtonColor QmlDesigner_HighlightColor=ff46a2da diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index 9540324154d..4f3f167b065 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -171,6 +171,7 @@ public: CodeModel_Error_TextMarkColor, CodeModel_Warning_TextMarkColor, + CodeModel_Info_TextMarkColor, /* Output panes */ diff --git a/src/plugins/languageclient/diagnosticmanager.cpp b/src/plugins/languageclient/diagnosticmanager.cpp index c437a9f1be6..d584f83134d 100644 --- a/src/plugins/languageclient/diagnosticmanager.cpp +++ b/src/plugins/languageclient/diagnosticmanager.cpp @@ -39,13 +39,19 @@ public: { setLineAnnotation(diag.message()); setToolTip(diag.message()); - const bool isError - = diag.severity().value_or(DiagnosticSeverity::Hint) == DiagnosticSeverity::Error; - setColor(isError ? Theme::CodeModel_Error_TextMarkColor - : Theme::CodeModel_Warning_TextMarkColor); - - setIcon(isError ? Icons::CODEMODEL_ERROR.icon() - : Icons::CODEMODEL_WARNING.icon()); + switch (diag.severity().value_or(DiagnosticSeverity::Hint)) { + case DiagnosticSeverity::Error: + setColor(Theme::CodeModel_Error_TextMarkColor); + setIcon(Icons::CODEMODEL_ERROR.icon()); + break; + case DiagnosticSeverity::Warning: + setColor(Theme::CodeModel_Warning_TextMarkColor); + setIcon(Icons::CODEMODEL_WARNING.icon()); + break; + default: + setColor(Theme::CodeModel_Info_TextMarkColor); + break; + } } }; @@ -257,16 +263,23 @@ void DiagnosticManager::setForceCreateTasks(bool forceCreateTasks) QTextEdit::ExtraSelection DiagnosticManager::createDiagnosticSelection( const LanguageServerProtocol::Diagnostic &diagnostic, QTextDocument *textDocument) const { + const DiagnosticSeverity severity = diagnostic.severity().value_or(DiagnosticSeverity::Warning); + TextStyle style; + if (severity == DiagnosticSeverity::Error) + style = C_ERROR; + else if (severity == DiagnosticSeverity::Warning) + style = C_ERROR; + else + return {}; + QTextCursor cursor(textDocument); cursor.setPosition(diagnostic.range().start().toPositionInDocument(textDocument)); cursor.setPosition(diagnostic.range().end().toPositionInDocument(textDocument), QTextCursor::KeepAnchor); - const FontSettings &fontSettings = TextEditorSettings::fontSettings(); - const DiagnosticSeverity severity = diagnostic.severity().value_or(DiagnosticSeverity::Warning); - const TextStyle style = severity == DiagnosticSeverity::Error ? C_ERROR : C_WARNING; + const QTextCharFormat format = TextEditorSettings::fontSettings().toTextCharFormat(style); - return QTextEdit::ExtraSelection{cursor, fontSettings.toTextCharFormat(style)}; + return QTextEdit::ExtraSelection{cursor, format}; } void DiagnosticManager::setExtraSelectionsId(const Utils::Id &extraSelectionsId)