aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/glsleditor
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@theqtcompany.com>2015-12-09 12:24:53 +0100
committerMarco Bubke <marco.bubke@theqtcompany.com>2015-12-09 11:31:02 +0000
commit6e5f90917f4cbe092816ac82434f827f67082f4d (patch)
treef818911b5f2a90ce67925d4dd95735cae2990a48 /src/plugins/glsleditor
parent4453ed4fc2ce5a0a662f8b6172562c16a1ca5eed (diff)
Use text settings instead of hard coded diagnostic text formats
Change-Id: Id51d03a46b4403d9224508ff3c7647b829ee69cd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r--src/plugins/glsleditor/glsleditor.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp
index b7fac825e0..3a35ccadf7 100644
--- a/src/plugins/glsleditor/glsleditor.cpp
+++ b/src/plugins/glsleditor/glsleditor.cpp
@@ -53,6 +53,7 @@
#include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h>
+#include <texteditor/fontsettings.h>
#include <texteditor/refactoroverlay.h>
#include <texteditor/textdocument.h>
#include <texteditor/syntaxhighlighter.h>
@@ -236,13 +237,10 @@ void GlslEditorWidget::updateDocumentNow()
CreateRanges createRanges(document(), doc);
createRanges(ast);
- QTextCharFormat errorFormat;
- errorFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
- errorFormat.setUnderlineColor(Qt::red);
+ const TextEditor::FontSettings &fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
- QTextCharFormat warningFormat;
- warningFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
- warningFormat.setUnderlineColor(Qt::darkYellow);
+ QTextCharFormat warningFormat = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
+ QTextCharFormat errorFormat = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
QList<QTextEdit::ExtraSelection> sels;
QSet<int> errors;