Editor: Simplify text marks

Moving defaultToolTip and color from TextMarkRegistry to TextMark.
Allowing every instance of a TextMark object to define these
information.

Change-Id: Iec1794372cf902b34d343402074e3999e7f9faf7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-06-01 08:48:11 +02:00
parent fe3facb015
commit 4322990926
11 changed files with 67 additions and 167 deletions

View File

@@ -5771,8 +5771,7 @@ void TextEditorWidgetPrivate::addSearchResultsToScrollBar(QVector<SearchResult>
Highlight markToHighlight(TextMark *mark, int lineNumber)
{
return Highlight(mark->category(), lineNumber,
TextMark::categoryColor(mark->category()),
return Highlight(mark->category(), lineNumber, mark->color(),
textMarkPrioToScrollBarPrio(mark->priority()));
}
@@ -5791,8 +5790,7 @@ void TextEditorWidgetPrivate::updateHighlightScrollBarNow()
// update text marks
foreach (TextMark *mark, m_document->marks()) {
Id category = mark->category();
if (!mark->isVisible() || !TextMark::categoryHasColor(category))
if (!mark->isVisible() || !mark->hasColor())
continue;
const QTextBlock &block = q->document()->findBlockByNumber(mark->lineNumber() - 1);
if (block.isVisible())