Commit 583b8dbe authored by David Schulz's avatar David Schulz
Browse files

Editor: Fix hihglighting current line in read only editors.

Task-number: QTCREATORBUG-10104
Change-Id: I3c4adb62c1cae61e9eb409a58359a687852023a1
Reviewed-by: default avatarDaniel Teske <>
Reviewed-by: default avatarEike Ziller <>
parent c1410878
......@@ -3473,8 +3473,8 @@ void TextEditorWidget::paintEvent(QPaintEvent *e)
// draw backgrond to the right of the wrap column before everything else
qreal lineX = 0;
QPointF offset(contentOffset());
QRect viewportRect = viewport()->rect();
QRect er = e->rect();
const QRect &viewportRect = viewport()->rect();
const QRect &er = e->rect();
const FontSettings &fs = textDocument()->fontSettings();
const QTextCharFormat &searchScopeFormat = fs.toTextCharFormat(C_SEARCH_SCOPE);
......@@ -3828,6 +3828,12 @@ void TextEditorWidget::paintEvent(QPaintEvent *e)
QColor color = fs.toTextCharFormat(C_CURRENT_LINE).background().color();
// set alpha, otherwise we cannot see block highlighting and find scope underneath
if (!editable && !er.contains(rr.toRect())) {
QRect updateRect = er;
updateRect.setRight(viewportRect.width() - offset.x());
painter.fillRect(rr, color);
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