mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibGUI: Make focus events more aware of why focus is changing
This patch adds GUI::FocusEvent which has a GUI::FocusSource. The focus source is one of three things: - Programmatic - Mouse - Keyboard This allows receivers of focus events to implement different behaviors depending on how they receive/lose focus.
This commit is contained in:
@@ -1147,7 +1147,7 @@ void TextEditor::set_cursor(const TextPosition& a_position)
|
||||
m_highlighter->cursor_did_change();
|
||||
}
|
||||
|
||||
void TextEditor::focusin_event(Core::Event&)
|
||||
void TextEditor::focusin_event(FocusEvent&)
|
||||
{
|
||||
m_cursor_state = true;
|
||||
update_cursor();
|
||||
@@ -1156,7 +1156,7 @@ void TextEditor::focusin_event(Core::Event&)
|
||||
on_focusin();
|
||||
}
|
||||
|
||||
void TextEditor::focusout_event(Core::Event&)
|
||||
void TextEditor::focusout_event(FocusEvent&)
|
||||
{
|
||||
stop_timer();
|
||||
if (on_focusout)
|
||||
|
||||
Reference in New Issue
Block a user