forked from qt-creator/qt-creator
Use text settings instead of hard coded diagnostic text formats
Change-Id: Id51d03a46b4403d9224508ff3c7647b829ee69cd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/tabsettings.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/syntaxhighlighter.h>
|
||||
#include <texteditor/refactoroverlay.h>
|
||||
#include <texteditor/codeassist/genericproposal.h>
|
||||
@@ -194,12 +195,13 @@ static void appendExtraSelectionsForMessages(
|
||||
sel.cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, d.loc.length);
|
||||
}
|
||||
|
||||
if (d.isWarning())
|
||||
sel.format.setUnderlineColor(Qt::darkYellow);
|
||||
else
|
||||
sel.format.setUnderlineColor(Qt::red);
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
|
||||
|
||||
if (d.isWarning())
|
||||
sel.format = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
|
||||
else
|
||||
sel.format = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
|
||||
|
||||
sel.format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
|
||||
sel.format.setToolTip(d.message);
|
||||
|
||||
selections->append(sel);
|
||||
|
||||
Reference in New Issue
Block a user