aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-09-12 10:03:35 +0200
committerEike Ziller <eike.ziller@qt.io>2018-09-12 11:22:57 +0000
commitbaf8cac967b6927992e6c59cc742c8a7d3ebc893 (patch)
tree09e008c741176d53cccaa8ae5be0a2d1b170f82e
parentc1a761a2251204297dfd78e0bf19cc16e53de52d (diff)
Fix colorization of change numbers in VCS annotations (like git blame)
Syntax highlighters get information on which text char format they should set, which is not necessarily equivalent with the resulting color in the editor. Currently the only way to explicitly get the color, is through the global text editor settings. Fix-up of 601eebd832e8f8a39d661031a44d5ee3c53bf718 Task-number: QTCREATORBUG-21041 Change-Id: I8fb6e79500d490438b2ccd27b162a3b80822c1ee Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/vcsbase/baseannotationhighlighter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp
index b95fe6a179..6b3154ab27 100644
--- a/src/plugins/vcsbase/baseannotationhighlighter.cpp
+++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp
@@ -25,6 +25,7 @@
#include "baseannotationhighlighter.h"
#include <texteditor/fontsettings.h>
+#include <texteditor/texteditorsettings.h>
#include <QDebug>
#include <QColor>
@@ -63,8 +64,10 @@ public:
void BaseAnnotationHighlighterPrivate::updateOtherFormats()
{
- m_background = q->formatForCategory(TextEditor::C_TEXT)
- .brushProperty(QTextFormat::BackgroundBrush).color();
+ m_background = TextEditor::TextEditorSettings::fontSettings()
+ .toTextCharFormat(TextEditor::C_TEXT)
+ .brushProperty(QTextFormat::BackgroundBrush)
+ .color();
q->setChangeNumbers(m_changeNumberMap.keys().toSet());
}