TextEditor: Add declaration format description

Change-Id: Ibea12f324308a07d7e549d60a1b1c5767659efb3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-03-02 11:24:03 +01:00
parent 1a49ec3ffb
commit 7834bf76f2
4 changed files with 8 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ public:
ShowBackgroundControl = 0x2,
ShowFontControls = 0x4,
ShowUnderlineControl = 0x8,
ShowFontAndUnderlineControls = ShowFontControls | ShowUnderlineControl,
AllControls = 0xF,
AllControlsExceptUnderline = AllControls & ~ShowUnderlineControl,
};

View File

@@ -99,6 +99,7 @@ const char *nameForStyle(TextStyle style)
case C_WARNING: return "Warning";
case C_WARNING_CONTEXT: return "WarningContext";
case C_DECLARATION: return "Declaration";
case C_LAST_STYLE_SENTINEL: return "LastStyleSentinel";
}

View File

@@ -98,6 +98,8 @@ enum TextStyle : quint8 {
C_ERROR,
C_ERROR_CONTEXT,
C_DECLARATION,
C_LAST_STYLE_SENTINEL
};

View File

@@ -305,7 +305,10 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
QColor(255, 190, 0),
QTextCharFormat::DotLine,
FormatDescription::ShowUnderlineControl);
formatDescr.emplace_back(C_DECLARATION,
tr("Declaration"),
tr("Declaration of a function, variable, and so on."),
FormatDescription::ShowFontAndUnderlineControls);
d->m_fontSettingsPage = new FontSettingsPage(formatDescr,
Constants::TEXT_EDITOR_FONT_SETTINGS,