diff --git a/src/plugins/texteditor/colorscheme.h b/src/plugins/texteditor/colorscheme.h index bc9d340b688..ef7e59e87f5 100644 --- a/src/plugins/texteditor/colorscheme.h +++ b/src/plugins/texteditor/colorscheme.h @@ -46,10 +46,6 @@ public: Format() = default; Format(const QColor &foreground, const QColor &background); - static Format createMixinFormat() { - return Format(QColor(), QColor()); - } - QColor foreground() const { return m_foreground; } void setForeground(const QColor &foreground); @@ -86,8 +82,8 @@ public: bool fromString(const QString &str); private: - QColor m_foreground = Qt::black; - QColor m_background = Qt::white; + QColor m_foreground; + QColor m_background; QColor m_underlineColor; double m_relativeForegroundSaturation = 0.0; double m_relativeForegroundLightness = 0.0; diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index a4957f1780a..c6b1710c7c9 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"),