From e371eafd4bde6f83ca7c9dd1373e41017851fe42 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 15 Sep 2020 13:33:37 +0200 Subject: [PATCH] Editor: Calculate annotation color based on editor color scheme Amends 9182d4eda75033bbbebf50e87e518adc33d499f6 Fixes: QTCREATORBUG-24644 Change-Id: Id34bfbc4ea3d1102835c7c1cf3afa1580dff01d8 Reviewed-by: Alessandro Portale --- src/plugins/texteditor/textmark.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index 47e5f54f761..dff6b86d63c 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -24,6 +24,8 @@ ****************************************************************************/ #include "textmark.h" + +#include "fontsettings.h" #include "textdocument.h" #include "texteditor.h" #include "texteditorplugin.h" @@ -139,8 +141,10 @@ void TextMark::paintAnnotation(QPainter &painter, QRectF *annotationRect, const QColor &markColor = m_color.has_value() ? Utils::creatorTheme()->color(m_color.value()).toHsl() : painter.pen().color(); + + const FontSettings &fontSettings = m_baseTextDocument->fontSettings(); const AnnotationColors &colors = AnnotationColors::getAnnotationColors( - markColor, painter.background().color()); + markColor, fontSettings.toTextCharFormat(C_TEXT).background().color()); painter.save(); QLinearGradient grad(rects.fadeInRect.topLeft() - contentOffset,