mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:17:34 +00:00
LibGUI: Focus the first focusable widget added to a window
It feels really awkward if nothing is focused when opening a window.
This commit is contained in:
parent
65d94a1e74
commit
4806cd122d
3 changed files with 11 additions and 2 deletions
|
@ -115,6 +115,8 @@ void Widget::child_event(Core::ChildEvent& event)
|
|||
else
|
||||
layout()->add_widget(Core::to<Widget>(*event.child()));
|
||||
}
|
||||
if (window() && event.child() && Core::is<Widget>(*event.child()))
|
||||
window()->did_add_widget({}, Core::to<Widget>(*event.child()));
|
||||
}
|
||||
if (event.type() == Event::ChildRemoved) {
|
||||
if (layout()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue