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 2c3f3970d5)
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-10-26 12:27:34 +02:00
committed by Orgad Shaneh
parent ac931e19d5
commit edc77e339f

View File

@@ -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());