mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
Browser: Focus input text field in JS console by default
This commit is contained in:
parent
79a5ba58a5
commit
107db38a51
Notes:
sideshowbarker
2024-07-19 04:39:58 +09:00
Author: https://github.com/nico
Commit: 107db38a51
Pull-request: https://github.com/SerenityOS/serenity/pull/2859
2 changed files with 7 additions and 0 deletions
|
@ -165,4 +165,8 @@ void ConsoleWidget::clear_output()
|
||||||
m_output_view->update();
|
m_output_view->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConsoleWidget::focusin_event(Core::Event&)
|
||||||
|
{
|
||||||
|
m_input->set_focus(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,9 @@ public:
|
||||||
private:
|
private:
|
||||||
ConsoleWidget();
|
ConsoleWidget();
|
||||||
|
|
||||||
|
virtual bool accepts_focus() const override { return true; }
|
||||||
|
virtual void focusin_event(Core::Event&) override;
|
||||||
|
|
||||||
RefPtr<GUI::TextBox> m_input;
|
RefPtr<GUI::TextBox> m_input;
|
||||||
RefPtr<Web::PageView> m_output_view;
|
RefPtr<Web::PageView> m_output_view;
|
||||||
RefPtr<Web::Element> m_output_container;
|
RefPtr<Web::Element> m_output_container;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue