mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibGUI: When focusing a TextEditor via keyboard, select all contents
This feels very natural and allows you to start typing immediately knowing it will replace whatever was in the text box before.
This commit is contained in:
@@ -1147,8 +1147,10 @@ void TextEditor::set_cursor(const TextPosition& a_position)
|
||||
m_highlighter->cursor_did_change();
|
||||
}
|
||||
|
||||
void TextEditor::focusin_event(FocusEvent&)
|
||||
void TextEditor::focusin_event(FocusEvent& event)
|
||||
{
|
||||
if (event.source() == FocusSource::Keyboard)
|
||||
select_all();
|
||||
m_cursor_state = true;
|
||||
update_cursor();
|
||||
start_timer(500);
|
||||
|
||||
Reference in New Issue
Block a user