From c4605ebc07685b7bb93cc668e41adfb1fc3968ab Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 10 May 2021 10:18:30 +0200 Subject: [PATCH] TextEditor: Fix painting text mark icons Only take text marks with icons into account when looking for the three textmarks with the highest priority to be drawn next to the line number. Fixes: QTCREATORBUG-25427 Change-Id: I9c0b9cac2e34134e59071a4e2357585b3071c303 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 8d50ec1b314..e9f64c5b3fe 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -5143,11 +5143,11 @@ void TextEditorWidgetPrivate::paintTextMarks(QPainter &painter, const ExtraAreaP TextMarks marks = userData->marks(); TextMarks::const_iterator it = marks.constBegin(); if (marks.size() > 3) { - // We want the 3 with the highest priority so iterate from the back + // We want the 3 with the highest priority that have an icon so iterate from the back int count = 0; it = marks.constEnd() - 1; while (it != marks.constBegin()) { - if ((*it)->isVisible()) + if ((*it)->isVisible() && !(*it)->icon().isNull()) ++count; if (count == 3) break; @@ -5157,7 +5157,7 @@ void TextEditorWidgetPrivate::paintTextMarks(QPainter &painter, const ExtraAreaP TextMarks::const_iterator end = marks.constEnd(); for ( ; it != end; ++it) { TextMark *mark = *it; - if (!mark->isVisible()) + if (!mark->isVisible() && !mark->icon().isNull()) continue; const int height = data.lineSpacing - 1; const int width = int(.5 + height * mark->widthFactor());