diff options
author | Nico Weber <thakis@chromium.org> | 2020-07-22 21:19:34 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-23 13:07:30 +0200 |
commit | 107db38a51d22e77848a7b04909f3ef4eabe2445 (patch) | |
tree | 6d0eb5d57ef5d20f5d2515d72fbfb837d7229096 /Applications/Browser | |
parent | 79a5ba58a5a318b913ec4ff9ba320f97128169e5 (diff) | |
download | serenity-107db38a51d22e77848a7b04909f3ef4eabe2445.zip |
Browser: Focus input text field in JS console by default
Diffstat (limited to 'Applications/Browser')
-rw-r--r-- | Applications/Browser/ConsoleWidget.cpp | 4 | ||||
-rw-r--r-- | Applications/Browser/ConsoleWidget.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Applications/Browser/ConsoleWidget.cpp b/Applications/Browser/ConsoleWidget.cpp index 67759e68a6..459043d991 100644 --- a/Applications/Browser/ConsoleWidget.cpp +++ b/Applications/Browser/ConsoleWidget.cpp @@ -165,4 +165,8 @@ void ConsoleWidget::clear_output() m_output_view->update(); } +void ConsoleWidget::focusin_event(Core::Event&) +{ + m_input->set_focus(true); +} } diff --git a/Applications/Browser/ConsoleWidget.h b/Applications/Browser/ConsoleWidget.h index 9b70deeebd..44a6f881f0 100644 --- a/Applications/Browser/ConsoleWidget.h +++ b/Applications/Browser/ConsoleWidget.h @@ -47,6 +47,9 @@ public: private: ConsoleWidget(); + virtual bool accepts_focus() const override { return true; } + virtual void focusin_event(Core::Event&) override; + RefPtr<GUI::TextBox> m_input; RefPtr<Web::PageView> m_output_view; RefPtr<Web::Element> m_output_container; |