Editor: Calculate annotation color based on editor color scheme

Amends 9182d4eda7

Fixes: QTCREATORBUG-24644
Change-Id: Id34bfbc4ea3d1102835c7c1cf3afa1580dff01d8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
David Schulz
2020-09-15 13:33:37 +02:00
parent 1da2c1f766
commit e371eafd4b

View File

@@ -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,