forked from qt-creator/qt-creator
Add default tool tips to text marks
The default tool tip should describe the general purpose of the mark which is displayed in the UI when no tool tip is explicitly set for the text mark. Change-Id: I27aff26cf0f3458d454428e805a9b323191dc393 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -129,6 +129,11 @@ void TextMark::setCategoryColor(Id category, Theme::Color color)
|
||||
TextEditorPlugin::baseTextMarkRegistry()->setCategoryColor(category, color);
|
||||
}
|
||||
|
||||
void TextMark::setDefaultToolTip(Id category, const QString &toolTip)
|
||||
{
|
||||
TextEditorPlugin::baseTextMarkRegistry()->setDefaultToolTip(category, toolTip);
|
||||
}
|
||||
|
||||
void TextMark::updateMarker()
|
||||
{
|
||||
if (m_baseTextDocument)
|
||||
@@ -259,6 +264,19 @@ void TextMarkRegistry::setCategoryColor(Id category, Theme::Color color)
|
||||
m_colors[category] = color;
|
||||
}
|
||||
|
||||
QString TextMarkRegistry::defaultToolTip(Id category) const
|
||||
{
|
||||
return m_defaultToolTips[category];
|
||||
}
|
||||
|
||||
void TextMarkRegistry::setDefaultToolTip(Id category, const QString &toolTip)
|
||||
{
|
||||
QString &defaultToolTip = m_defaultToolTips[category];
|
||||
if (defaultToolTip == toolTip)
|
||||
return;
|
||||
defaultToolTip = toolTip;
|
||||
}
|
||||
|
||||
void TextMarkRegistry::editorOpened(IEditor *editor)
|
||||
{
|
||||
auto document = qobject_cast<TextDocument *>(editor ? editor->document() : 0);
|
||||
|
||||
Reference in New Issue
Block a user