forked from qt-creator/qt-creator
Coco: use the diagnostic foreground color as annotation color
Change-Id: I4f0991c8956b0b31a441aa4348aaf8b7d0677dda Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -155,13 +155,12 @@ void TextMark::paintAnnotation(QPainter &painter,
|
||||
return;
|
||||
}
|
||||
|
||||
const QColor &markColor = m_color.has_value()
|
||||
? Utils::creatorTheme()->color(m_color.value()).toHsl()
|
||||
: painter.pen().color();
|
||||
const QColor &markColor = annotationColor();
|
||||
|
||||
const FontSettings &fontSettings = m_baseTextDocument->fontSettings();
|
||||
const AnnotationColors &colors = AnnotationColors::getAnnotationColors(
|
||||
markColor, fontSettings.toTextCharFormat(C_TEXT).background().color());
|
||||
markColor.isValid() ? markColor : painter.pen().color(),
|
||||
fontSettings.toTextCharFormat(C_TEXT).background().color());
|
||||
|
||||
painter.save();
|
||||
QLinearGradient grad(rects.fadeInRect.topLeft() - contentOffset,
|
||||
@@ -355,6 +354,13 @@ bool TextMark::addToolTipContent(QLayout *target) const
|
||||
return true;
|
||||
}
|
||||
|
||||
QColor TextMark::annotationColor() const
|
||||
{
|
||||
if (m_color.has_value())
|
||||
return Utils::creatorTheme()->color(*m_color).toHsl();
|
||||
return {};
|
||||
}
|
||||
|
||||
void TextMark::setIcon(const QIcon &icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
|
||||
Reference in New Issue
Block a user