diff options
author | David Schulz <david.schulz@qt.io> | 2020-09-18 13:37:37 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2020-09-21 07:16:43 +0000 |
commit | d99e00c49f8b15f05225d4fa160e8ed94026a83f (patch) | |
tree | ca0b7232f991163f926b9edbce382c6e2cc26f54 /src | |
parent | 7d21caabdb98660439f81da51bb212d5d857ce02 (diff) |
TextEditor: allow highlightings in selections
If the selection foregound color is undefined do not overwrite the
already applied highlighting.
Fixes: QTCREATORBUG-24656
Change-Id: Ia125e8e6b9efba73d5a13facc2446a793d59f5c3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/texteditor/texteditor.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 07f8570483..8a2036f524 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4724,8 +4724,7 @@ void TextEditorWidgetPrivate::setupSelections(const PaintEventData &data, const QTextCharFormat selectionFormat = data.fontSettings.toTextCharFormat(C_SELECTION); if (selectionFormat.background().style() != Qt::NoBrush) o.format.setBackground(selectionFormat.background()); - if (selectionFormat.foreground().style() != Qt::NoBrush) - o.format.setForeground(selectionFormat.foreground()); + o.format.setForeground(selectionFormat.foreground()); } if ((data.textCursor.hasSelection() && i == data.context.selections.size() - 1) || (o.format.foreground().style() == Qt::NoBrush |