forked from qt-creator/qt-creator
Editor: paint location marker over everything else
The location marker is updated very regularly and especially while stepping moves one line at a time. Resizing this marker when it enters a line that already contains a marker is visually distracting. To prevent this paint the marker over all other markers in that line. Change-Id: I63ad72384e77eeae4dc6d2e2c2ac77c88da92c56 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -983,6 +983,10 @@ bool TextDocument::addMark(TextMark *mark)
|
||||
// Update document layout
|
||||
bool fullUpdate = !documentLayout->hasMarks;
|
||||
documentLayout->hasMarks = true;
|
||||
if (!documentLayout->hasLocationMarker && mark->isLocationMarker()) {
|
||||
documentLayout->hasLocationMarker = true;
|
||||
fullUpdate = true;
|
||||
}
|
||||
if (fullUpdate)
|
||||
documentLayout->scheduleUpdate();
|
||||
else
|
||||
@@ -1018,6 +1022,11 @@ void TextDocument::removeMarkFromMarksCache(TextMark *mark)
|
||||
Qt::QueuedConnection);
|
||||
};
|
||||
|
||||
if (mark->isLocationMarker()) {
|
||||
documentLayout->hasLocationMarker = false;
|
||||
scheduleLayoutUpdate();
|
||||
}
|
||||
|
||||
if (d->m_marksCache.isEmpty()) {
|
||||
documentLayout->hasMarks = false;
|
||||
scheduleLayoutUpdate();
|
||||
|
||||
Reference in New Issue
Block a user