mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00:00
LibGUI: Paint text selections as active in Popups
And hide TextEditor cursors in active windows when focus is preempted
This commit is contained in:
parent
f7eb72a8be
commit
a6581c2aac
1 changed files with 3 additions and 3 deletions
|
@ -727,8 +727,8 @@ void TextEditor::paint_event(PaintEvent& event)
|
||||||
visual_line_rect.height()
|
visual_line_rect.height()
|
||||||
};
|
};
|
||||||
|
|
||||||
Color background_color = window()->is_active() ? palette().selection() : palette().inactive_selection();
|
Color background_color = is_focused() ? palette().selection() : palette().inactive_selection();
|
||||||
Color text_color = window()->is_active() ? palette().selection_text() : palette().inactive_selection_text();
|
Color text_color = is_focused() ? palette().selection_text() : palette().inactive_selection_text();
|
||||||
|
|
||||||
painter.fill_rect(selection_rect, background_color);
|
painter.fill_rect(selection_rect, background_color);
|
||||||
|
|
||||||
|
@ -748,7 +748,7 @@ void TextEditor::paint_event(PaintEvent& event)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_enabled() && is_focused() && m_cursor_state && !is_displayonly())
|
if (is_enabled() && is_focused() && !focus_preempted() && m_cursor_state && !is_displayonly())
|
||||||
painter.fill_rect(cursor_content_rect(), palette().text_cursor());
|
painter.fill_rect(cursor_content_rect(), palette().text_cursor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue