forked from qt-creator/qt-creator
TextEditor: fix underlined text Bg color
Set default bg color to NoBrush. Previously caused incorrect painting when underline style was set without background. Task-number: QTCREATORBUG-18101 Change-Id: I4c1d86a3c711a3962e01ccf3a937dafa36b68ec2 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -174,6 +174,11 @@ QTextCharFormat FontSettings::toTextCharFormat(TextStyle category) const
|
|||||||
tf.setForeground(f.foreground());
|
tf.setForeground(f.foreground());
|
||||||
if (f.background().isValid() && (category == C_TEXT || f.background() != m_scheme.formatFor(C_TEXT).background()))
|
if (f.background().isValid() && (category == C_TEXT || f.background() != m_scheme.formatFor(C_TEXT).background()))
|
||||||
tf.setBackground(f.background());
|
tf.setBackground(f.background());
|
||||||
|
|
||||||
|
// underline does not need to fill without having background color
|
||||||
|
if (f.underlineStyle() != QTextCharFormat::NoUnderline && !f.background().isValid())
|
||||||
|
tf.setBackground(QBrush(Qt::BrushStyle::NoBrush));
|
||||||
|
|
||||||
tf.setFontWeight(f.bold() ? QFont::Bold : QFont::Normal);
|
tf.setFontWeight(f.bold() ? QFont::Bold : QFont::Normal);
|
||||||
tf.setFontItalic(f.italic());
|
tf.setFontItalic(f.italic());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user