Editor: always paint complete line when painting current line highlight

If the paint event rect does not contain the complete line, request an
update with the full line width also for editable editors. This fixes
current line highlight issues in the commit reword editor.

Change-Id: I6b93230a47bdd61248c1aa9631208606cbbae7c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-11-07 09:56:45 +01:00
parent 77a033d397
commit cb908779a9

View File

@@ -4334,7 +4334,7 @@ void TextEditorWidgetPrivate::paintCurrentLineHighlight(const PaintEventData &da
QColor color = m_document->fontSettings().toTextCharFormat(C_CURRENT_LINE).background().color();
// set alpha, otherwise we cannot see block highlighting and find scope underneath
color.setAlpha(128);
if (!data.isEditable && !data.eventRect.contains(lineRect.toRect())) {
if (!data.eventRect.contains(lineRect.toRect())) {
QRect updateRect = data.eventRect;
updateRect.setLeft(0);
updateRect.setRight(data.viewportRect.width() - int(data.offset.x()));