Commit 72e9afd8 authored by Eike Ziller's avatar Eike Ziller

Fix underline color in diff description when hovering

Since e.g. whitespace can have a different foreground color than
"normal" text, we have to explicitly set the color for the underline
when hovering. Use foreground color if there is no specific text color
set for "normal" text.

Change-Id: I9825d24af0d598b039a0db9ed86966605e22ac04
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@qt.io>
parent e829ca8e
......@@ -34,6 +34,7 @@
#include <coreplugin/minisplitter.h>
#include <texteditor/displaysettings.h>
#include <texteditor/fontsettings.h>
#include <texteditor/marginsettings.h>
#include <texteditor/syntaxhighlighter.h>
#include <texteditor/textdocument.h>
......@@ -198,7 +199,9 @@ void DescriptionEditorWidget::highlightCurrentContents()
QTextEdit::ExtraSelection sel;
sel.cursor = m_currentCursor;
sel.cursor.select(QTextCursor::LineUnderCursor);
sel.format.setFontUnderline(true);
sel.format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
const QColor textColor = TextEditorSettings::fontSettings().formatFor(C_TEXT).foreground();
sel.format.setUnderlineColor(textColor.isValid() ? textColor : palette().color(QPalette::Foreground));
setExtraSelections(TextEditorWidget::OtherSelection,
QList<QTextEdit::ExtraSelection>() << sel);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment