From edc77e339f1afb881d07f5b1f74878a06a844746 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 26 Oct 2015 12:27:34 +0200 Subject: [PATCH] TextEditor: Default to Text style on style absence (take 2) The current default is black foreground, which is invisible on dark color schemes. Change-Id: Iaa2520422ea6a6b355c89d71d204a7620aa98fcd (cherry picked from commit 2c3f3970d56b525b8f79dfa2bcdafa13880e0130) Reviewed-by: David Schulz --- src/plugins/texteditor/fontsettings.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index 565dd690f6b..f04e4881d76 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -363,8 +363,15 @@ bool FontSettings::loadColorScheme(const QString &fileName, if (!m_scheme.contains(id)) { Format format; const Format &descFormat = desc.format(); - format.setForeground(descFormat.foreground()); - format.setBackground(descFormat.background()); + if (descFormat == format && m_scheme.contains(C_TEXT)) { + // Default format -> Text + const Format textFormat = m_scheme.formatFor(C_TEXT); + format.setForeground(textFormat.foreground()); + format.setBackground(textFormat.background()); + } else { + format.setForeground(descFormat.foreground()); + format.setBackground(descFormat.background()); + } format.setBold(descFormat.bold()); format.setItalic(descFormat.italic()); format.setUnderlineColor(descFormat.underlineColor());