From 7834bf76f2c0134c5175cd157aea4e3b51ee3eb5 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 2 Mar 2016 11:24:03 +0100 Subject: [PATCH] TextEditor: Add declaration format description Change-Id: Ibea12f324308a07d7e549d60a1b1c5767659efb3 Reviewed-by: David Schulz --- src/plugins/texteditor/fontsettingspage.h | 1 + src/plugins/texteditor/texteditorconstants.cpp | 1 + src/plugins/texteditor/texteditorconstants.h | 2 ++ src/plugins/texteditor/texteditorsettings.cpp | 5 ++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index 1d3d676def3..16365a45145 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -57,6 +57,7 @@ public: ShowBackgroundControl = 0x2, ShowFontControls = 0x4, ShowUnderlineControl = 0x8, + ShowFontAndUnderlineControls = ShowFontControls | ShowUnderlineControl, AllControls = 0xF, AllControlsExceptUnderline = AllControls & ~ShowUnderlineControl, }; diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index 5d137a1e274..b638ff4d17b 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -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"; } diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 19cf640957a..ff69f45cb51 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -98,6 +98,8 @@ enum TextStyle : quint8 { C_ERROR, C_ERROR_CONTEXT, + C_DECLARATION, + C_LAST_STYLE_SENTINEL }; diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index f5d45c04faa..f47f4eceb1d 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -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,