mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibGUI: Allow widgets to make themselves non-auto-focusable
This patchs adds a way for widgets exclude themselves from being a focus candidate in Window::focus_a_widget_if_possible(). This is to allow the URL box to not get auto-focused when the browser is loaded.
This commit is contained in:
parent
6f19bf8501
commit
fbf824a50f
2 changed files with 6 additions and 0 deletions
|
@ -947,6 +947,8 @@ Vector<Widget&> Window::focusable_widgets(FocusSource source) const
|
|||
return IterationDecision::Continue;
|
||||
if (!child.is_enabled())
|
||||
return IterationDecision::Continue;
|
||||
if (!child.is_auto_focusable())
|
||||
return IterationDecision::Continue;
|
||||
collect_focusable_widgets(child);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue