TextEditor: Add global variable text styles

Change-Id: I088dc484b6a4ace79609ca7fcc4145344ccea5a9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-03-07 11:59:01 +01:00
parent f8e64a87bb
commit 40c4f7847f
6 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
<style name="Doxygen.Tag" foreground="#00a0a0"/> <style name="Doxygen.Tag" foreground="#00a0a0"/>
<style name="Field"/> <style name="Field"/>
<style name="Function"/> <style name="Function"/>
<style name="Global"/>
<style name="Keyword" foreground="#ffff55"/> <style name="Keyword" foreground="#ffff55"/>
<style name="PrimitiveType" foreground="#ffff55"/> <style name="PrimitiveType" foreground="#ffff55"/>
<style name="Label" foreground="#ffff55"/> <style name="Label" foreground="#ffff55"/>

View File

@@ -20,6 +20,7 @@
<style name="Doxygen.Tag" foreground="#4e5ab3"/> <style name="Doxygen.Tag" foreground="#4e5ab3"/>
<style name="Field" bold="true"/> <style name="Field" bold="true"/>
<style name="Function"/> <style name="Function"/>
<style name="Global"/>
<style name="Keyword" foreground="#808bed"/> <style name="Keyword" foreground="#808bed"/>
<style name="PrimitiveType" foreground="#808bed"/> <style name="PrimitiveType" foreground="#808bed"/>
<style name="Label" foreground="#e76000"/> <style name="Label" foreground="#e76000"/>

View File

@@ -48,6 +48,8 @@ TextEditor::TextStyle toTextStyle(ClangBackEnd::HighlightingType type)
return TextEditor::C_LOCAL; return TextEditor::C_LOCAL;
case HighlightingType::Field: case HighlightingType::Field:
return TextEditor::C_FIELD; return TextEditor::C_FIELD;
case HighlightingType::GlobalVariable:
return TextEditor::C_GLOBAL;
case HighlightingType::Enumeration: case HighlightingType::Enumeration:
return TextEditor::C_ENUMERATION; return TextEditor::C_ENUMERATION;
case HighlightingType::Label: case HighlightingType::Label:

View File

@@ -52,6 +52,7 @@ const char *nameForStyle(TextStyle style)
case C_STRING: return "String"; case C_STRING: return "String";
case C_TYPE: return "Type"; case C_TYPE: return "Type";
case C_LOCAL: return "Local"; case C_LOCAL: return "Local";
case C_GLOBAL: return "Global";
case C_FIELD: return "Field"; case C_FIELD: return "Field";
// TODO: Rename "Static" to "Enumeration" in next major update, // TODO: Rename "Static" to "Enumeration" in next major update,
// because renaming here would break styles defined by the user. // because renaming here would break styles defined by the user.

View File

@@ -51,6 +51,7 @@ enum TextStyle : quint8 {
C_STRING, C_STRING,
C_TYPE, C_TYPE,
C_LOCAL, C_LOCAL,
C_GLOBAL,
C_FIELD, C_FIELD,
C_ENUMERATION, C_ENUMERATION,
C_VIRTUAL_METHOD, C_VIRTUAL_METHOD,

View File

@@ -157,6 +157,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescr.emplace_back(C_LOCAL, tr("Local"), tr("Local variables.")); formatDescr.emplace_back(C_LOCAL, tr("Local"), tr("Local variables."));
formatDescr.emplace_back(C_FIELD, tr("Field"), formatDescr.emplace_back(C_FIELD, tr("Field"),
tr("Class' data members."), Qt::darkRed); tr("Class' data members."), Qt::darkRed);
formatDescr.emplace_back(C_GLOBAL, tr("Global"), tr("Global variables."));
formatDescr.emplace_back(C_ENUMERATION, tr("Enumeration"), formatDescr.emplace_back(C_ENUMERATION, tr("Enumeration"),
tr("Applied to enumeration items."), Qt::darkMagenta); tr("Applied to enumeration items."), Qt::darkMagenta);