diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-14 19:56:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-15 00:05:45 +0200 |
commit | 75b8f4e4e6ad4934c652d9af8134660ad86b75f7 (patch) | |
tree | 0636f91cacd68000e2586d128bf154639cbf2dcd /Applications | |
parent | 110b3d89d3da62a1c9acde24a143b5e6871301b0 (diff) | |
download | serenity-75b8f4e4e6ad4934c652d9af8134660ad86b75f7.zip |
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.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Browser/ConsoleWidget.cpp | 2 | ||||
-rw-r--r-- | Applications/Browser/ConsoleWidget.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Applications/Browser/ConsoleWidget.cpp b/Applications/Browser/ConsoleWidget.cpp index 9d9e22f43c..23e43be4c0 100644 --- a/Applications/Browser/ConsoleWidget.cpp +++ b/Applications/Browser/ConsoleWidget.cpp @@ -165,7 +165,7 @@ void ConsoleWidget::clear_output() m_output_view->update(); } -void ConsoleWidget::focusin_event(Core::Event&) +void ConsoleWidget::focusin_event(GUI::FocusEvent&) { m_input->set_focus(true); } diff --git a/Applications/Browser/ConsoleWidget.h b/Applications/Browser/ConsoleWidget.h index cb1a1313a8..afc6178ffc 100644 --- a/Applications/Browser/ConsoleWidget.h +++ b/Applications/Browser/ConsoleWidget.h @@ -48,7 +48,7 @@ private: ConsoleWidget(); virtual bool accepts_focus() const override { return true; } - virtual void focusin_event(Core::Event&) override; + virtual void focusin_event(GUI::FocusEvent&) override; RefPtr<GUI::TextBox> m_input; RefPtr<Web::PageView> m_output_view; |