From f2bd50c466e71c2cb6b6c9e2a789a6d97578eaa2 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 11 Oct 2018 14:19:54 +0200 Subject: TextEditor: Remove defaults from Format The default caused strange bugs because it was expected that no color was set. Task-number: QTCREATORBUG-21282 Change-Id: I3b520b944ffcb87838ba3e7b02e1d28b0f757679 Reviewed-by: Alessandro Portale --- src/plugins/texteditor/texteditorsettings.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/texteditor/texteditorsettings.cpp') diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index a4957f1780..c6b1710c7c 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -92,8 +92,10 @@ TextEditorSettings::TextEditorSettings() // Add font preference page FormatDescriptions formatDescr; formatDescr.reserve(C_LAST_STYLE_SENTINEL); - formatDescr.emplace_back(C_TEXT, tr("Text"), tr("Generic text and punctuation tokens.\n" - "Applied to text that matched no other rule.")); + formatDescr.emplace_back(C_TEXT, tr("Text"), + tr("Generic text and punctuation tokens.\n" + "Applied to text that matched no other rule."), + Format{QColor{}, Qt::white}); // Special categories const QPalette p = QApplication::palette(); @@ -168,7 +170,7 @@ 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(); + Format declarationFormat; declarationFormat.setBold(true); formatDescr.emplace_back(C_DECLARATION, tr("Function Declaration"), @@ -178,7 +180,6 @@ TextEditorSettings::TextEditorSettings() formatDescr.emplace_back(C_FUNCTION_DEFINITION, tr("Function Definition"), tr("Name of function at its definition."), - Format::createMixinFormat(), FormatDescription::ShowAllControls); Format virtualFunctionFormat(functionFormat); virtualFunctionFormat.setItalic(true); @@ -242,7 +243,6 @@ 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(), FormatDescription::ShowAllControls); formatDescr.emplace_back(C_OVERLOADED_OPERATOR, tr("Overloaded Operators"), @@ -335,7 +335,7 @@ TextEditorSettings::TextEditorSettings() QColor(255, 190, 0), QTextCharFormat::DotLine, FormatDescription::ShowAllControls); - Format outputArgumentFormat = Format::createMixinFormat(); + Format outputArgumentFormat; outputArgumentFormat.setItalic(true); formatDescr.emplace_back(C_OUTPUT_ARGUMENT, tr("Output Argument"), -- cgit v1.2.3