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 601eebd832

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>
This commit is contained in:
Eike Ziller
2018-09-12 10:03:35 +02:00
parent c1a761a225
commit baf8cac967

View File

@@ -25,6 +25,7 @@
#include "baseannotationhighlighter.h" #include "baseannotationhighlighter.h"
#include <texteditor/fontsettings.h> #include <texteditor/fontsettings.h>
#include <texteditor/texteditorsettings.h>
#include <QDebug> #include <QDebug>
#include <QColor> #include <QColor>
@@ -63,8 +64,10 @@ public:
void BaseAnnotationHighlighterPrivate::updateOtherFormats() void BaseAnnotationHighlighterPrivate::updateOtherFormats()
{ {
m_background = q->formatForCategory(TextEditor::C_TEXT) m_background = TextEditor::TextEditorSettings::fontSettings()
.brushProperty(QTextFormat::BackgroundBrush).color(); .toTextCharFormat(TextEditor::C_TEXT)
.brushProperty(QTextFormat::BackgroundBrush)
.color();
q->setChangeNumbers(m_changeNumberMap.keys().toSet()); q->setChangeNumbers(m_changeNumberMap.keys().toSet());
} }