mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
@@ -181,13 +181,13 @@ void TerminalWidget::set_logical_focus(bool focus)
|
||||
update();
|
||||
}
|
||||
|
||||
void TerminalWidget::focusin_event(Core::Event& event)
|
||||
void TerminalWidget::focusin_event(GUI::FocusEvent& event)
|
||||
{
|
||||
set_logical_focus(true);
|
||||
return GUI::Frame::focusin_event(event);
|
||||
}
|
||||
|
||||
void TerminalWidget::focusout_event(Core::Event& event)
|
||||
void TerminalWidget::focusout_event(GUI::FocusEvent& event)
|
||||
{
|
||||
set_logical_focus(false);
|
||||
return GUI::Frame::focusout_event(event);
|
||||
|
||||
Reference in New Issue
Block a user