forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user