1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 03:35:07 +00:00

GTextEditor: Only draw the cursor line background shade when focused.

This commit is contained in:
Andreas Kling 2019-03-07 02:26:44 +01:00
parent 6db132069f
commit dff57909a7

View file

@ -98,7 +98,7 @@ void GTextEditor::paint_event(GPaintEvent& event)
auto& line = m_lines[i];
auto line_rect = line_content_rect(i);
line_rect.set_width(exposed_width);
if (i == m_cursor.line())
if (i == m_cursor.line() && is_focused())
painter.fill_rect(line_rect, Color(230, 230, 230));
painter.draw_text(line_rect, line.text(), TextAlignment::CenterLeft, Color::Black);
}