aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditorsettings.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2018-09-24 14:51:06 +0200
committerMarco Bubke <marco.bubke@qt.io>2018-09-25 11:18:03 +0000
commit63eae7932feb39c7be2ea222b15f359849cf592b (patch)
tree36280aa6a48c9be0bda06180e072712f5589b814 /src/plugins/texteditor/texteditorsettings.cpp
parent4e6d09d8e1e9ba776ee20000d5a39b46ce2c25af (diff)
TextEditor: Cleanup text styles
So far there were different settings for different mix-ins. There was no technical reason why we limit the user. So you can set now the color, the relative saturation and value, the font, underline, italic and bold. The relative saturation and value are disabled if the color is set. The settings are reordered too so the order reflects the semantic meaning much better. Change-Id: I440967d6729f720816d2bc028ff9fe8e8868074e Task-number: QTCREATORBUG-21105 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditorsettings.cpp')
-rw-r--r--src/plugins/texteditor/texteditorsettings.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp
index 0c02eb3cd1..f5cc088f22 100644
--- a/src/plugins/texteditor/texteditorsettings.cpp
+++ b/src/plugins/texteditor/texteditorsettings.cpp
@@ -103,7 +103,7 @@ TextEditorSettings::TextEditorSettings()
p.color(QPalette::HighlightedText));
formatDescr.emplace_back(C_LINE_NUMBER, tr("Line Number"),
tr("Line numbers located on the left side of the editor."),
- FormatDescription::AllControlsExceptUnderline);
+ FormatDescription::ShowAllAbsoluteControlsExceptUnderline);
formatDescr.emplace_back(C_SEARCH_RESULT, tr("Search Result"),
tr("Highlighted search results inside the editor."),
FormatDescription::ShowBackgroundControl);
@@ -128,7 +128,7 @@ TextEditorSettings::TextEditorSettings()
tr("Line number located on the left side of the "
"editor where the cursor is placed in."),
Qt::darkGray,
- FormatDescription::AllControlsExceptUnderline);
+ FormatDescription::ShowAllAbsoluteControlsExceptUnderline);
currentLineNumber.format().setBold(true);
formatDescr.push_back(std::move(currentLineNumber));
@@ -168,6 +168,18 @@ TextEditorSettings::TextEditorSettings()
functionFormat.setForeground(QColor(0, 103, 124));
formatDescr.emplace_back(C_FUNCTION, tr("Function"), tr("Name of a function."),
functionFormat);
+ Format declarationFormat = Format::createMixinFormat();
+ declarationFormat.setBold(true);
+ formatDescr.emplace_back(C_DECLARATION,
+ tr("Function Declaration"),
+ tr("Style adjustments to (function) declarations."),
+ declarationFormat,
+ FormatDescription::ShowAllControls);
+ formatDescr.emplace_back(C_FUNCTION_DEFINITION,
+ tr("Function Definition"),
+ tr("Name of function at its definition."),
+ Format::createMixinFormat(),
+ FormatDescription::ShowAllControls);
functionFormat.setItalic(true);
formatDescr.emplace_back(C_VIRTUAL_METHOD, tr("Virtual Function"),
tr("Name of function declared as virtual."),
@@ -229,11 +241,13 @@ TextEditorSettings::TextEditorSettings()
formatDescr.emplace_back(C_OPERATOR, tr("Operator"),
tr("Non user-defined language operators.\n"
"To style user-defined operators, use Overloaded Operator."),
- Format::createMixinFormat());
+ Format::createMixinFormat(),
+ FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_OVERLOADED_OPERATOR,
tr("Overloaded Operators"),
tr("Calls and declarations of overloaded (user-defined) operators."),
- Format::createMixinFormat());
+ Format::createMixinFormat(),
+ FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_PREPROCESSOR, tr("Preprocessor"),
tr("Preprocessor directives."), Qt::darkBlue);
formatDescr.emplace_back(C_LABEL, tr("Label"), tr("Labels for goto statements."),
@@ -301,43 +315,32 @@ TextEditorSettings::TextEditorSettings()
tr("Underline color of error diagnostics."),
QColor(255,0, 0),
QTextCharFormat::SingleUnderline,
- FormatDescription::ShowUnderlineControl);
+ FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_ERROR_CONTEXT,
tr("Error Context"),
tr("Underline color of the contexts of error diagnostics."),
QColor(255,0, 0),
QTextCharFormat::DotLine,
- FormatDescription::ShowUnderlineControl);
+ FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_WARNING,
tr("Warning"),
tr("Underline color of warning diagnostics."),
QColor(255, 190, 0),
QTextCharFormat::SingleUnderline,
- FormatDescription::ShowUnderlineControl);
+ FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_WARNING_CONTEXT,
tr("Warning Context"),
tr("Underline color of the contexts of warning diagnostics."),
QColor(255, 190, 0),
QTextCharFormat::DotLine,
- FormatDescription::ShowUnderlineControl);
- Format declarationFormat = Format::createMixinFormat();
- declarationFormat.setBold(true);
- formatDescr.emplace_back(C_DECLARATION,
- tr("Function Declaration"),
- tr("Style adjustments to (function) declarations."),
- declarationFormat,
- FormatDescription::ShowFontUnderlineAndRelativeControls);
- formatDescr.emplace_back(C_FUNCTION_DEFINITION,
- tr("Function Definition"),
- tr("Name of function at its definition."),
- Format::createMixinFormat());
+ FormatDescription::ShowAllControls);
Format outputArgumentFormat = Format::createMixinFormat();
outputArgumentFormat.setItalic(true);
formatDescr.emplace_back(C_OUTPUT_ARGUMENT,
tr("Output Argument"),
tr("Writable arguments of a function call."),
outputArgumentFormat,
- FormatDescription::ShowFontUnderlineAndRelativeControls);
+ FormatDescription::ShowAllControls);
d->m_fontSettingsPage = new FontSettingsPage(formatDescr,
Constants::TEXT_EDITOR_FONT_SETTINGS,