Editor: Add Check for TextMark color definition.

Change-Id: I805402a5ec9595bd31b6d72c5934198c77a1f402
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
David Schulz
2015-05-27 14:32:44 +02:00
parent 19f63a5d8a
commit 3ceec86577
3 changed files with 12 additions and 0 deletions

View File

@@ -122,6 +122,11 @@ Theme::Color TextMark::categoryColor(Id category)
return TextEditorPlugin::baseTextMarkRegistry()->categoryColor(category); return TextEditorPlugin::baseTextMarkRegistry()->categoryColor(category);
} }
bool TextMark::categoryHasColor(Id category)
{
return TextEditorPlugin::baseTextMarkRegistry()->categoryHasColor(category);
}
void TextMark::setCategoryColor(Id category, Theme::Color color) void TextMark::setCategoryColor(Id category, Theme::Color color)
{ {
TextEditorPlugin::baseTextMarkRegistry()->setCategoryColor(category, color); TextEditorPlugin::baseTextMarkRegistry()->setCategoryColor(category, color);
@@ -230,6 +235,11 @@ Theme::Color TextMarkRegistry::categoryColor(Id category)
return m_colors.value(category, Theme::ProjectExplorer_TaskWarn_TextMarkColor); return m_colors.value(category, Theme::ProjectExplorer_TaskWarn_TextMarkColor);
} }
bool TextMarkRegistry::categoryHasColor(Id category)
{
return m_colors.contains(category);
}
void TextMarkRegistry::setCategoryColor(Id category, Theme::Color color) void TextMarkRegistry::setCategoryColor(Id category, Theme::Color color)
{ {
if (m_colors[category] == color) if (m_colors[category] == color)

View File

@@ -81,6 +81,7 @@ public:
virtual void dragToLine(int lineNumber); virtual void dragToLine(int lineNumber);
static Utils::Theme::Color categoryColor(Core::Id category); static Utils::Theme::Color categoryColor(Core::Id category);
static bool categoryHasColor(Core::Id category);
static void setCategoryColor(Core::Id category, Utils::Theme::Color color); static void setCategoryColor(Core::Id category, Utils::Theme::Color color);
void setIcon(const QIcon &icon); void setIcon(const QIcon &icon);
// call this if the icon has changed. // call this if the icon has changed.

View File

@@ -59,6 +59,7 @@ public:
void add(TextMark *mark); void add(TextMark *mark);
bool remove(TextMark *mark); bool remove(TextMark *mark);
Utils::Theme::Color categoryColor(Core::Id category); Utils::Theme::Color categoryColor(Core::Id category);
bool categoryHasColor(Core::Id category);
void setCategoryColor(Core::Id category, Utils::Theme::Color color); void setCategoryColor(Core::Id category, Utils::Theme::Color color);
private slots: private slots:
void editorOpened(Core::IEditor *editor); void editorOpened(Core::IEditor *editor);