diff options
author | David Schulz <david.schulz@qt.io> | 2020-09-15 13:33:37 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2020-09-16 07:20:20 +0000 |
commit | e371eafd4bde6f83ca7c9dd1373e41017851fe42 (patch) | |
tree | c2709ebe75ef7500a869cbf2bdf309c563efaef2 | |
parent | 1da2c1f7666ced45d6eea1cd0adfdc68a828e3a0 (diff) |
Editor: Calculate annotation color based on editor color scheme
Amends 9182d4eda75033bbbebf50e87e518adc33d499f6
Fixes: QTCREATORBUG-24644
Change-Id: Id34bfbc4ea3d1102835c7c1cf3afa1580dff01d8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/texteditor/textmark.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index 47e5f54f76..dff6b86d63 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, |