mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibGUI: Improve TabWidget+StackWidget focus behavior further
When setting a new active widget, transfer focus if it's anywhere in the old active widget's tree, not just at the immediate child.
This commit is contained in:
@@ -43,7 +43,7 @@ void StackWidget::set_active_widget(Widget* widget)
|
||||
if (widget == m_active_widget)
|
||||
return;
|
||||
|
||||
bool active_widget_had_focus = m_active_widget && window() && window()->focused_widget() == m_active_widget;
|
||||
bool active_widget_had_focus = m_active_widget && window() && (window()->focused_widget() == m_active_widget || m_active_widget->is_ancestor_of(*window()->focused_widget()));
|
||||
|
||||
if (m_active_widget)
|
||||
m_active_widget->set_visible(false);
|
||||
|
||||
Reference in New Issue
Block a user