mirror of
https://github.com/RGBCube/serenity
synced 2025-07-07 20:17:34 +00:00
LibGUI: TabWidget should not steal focus on programmatic tab switch
This matches the behavior of GUI::StackWidget.
This commit is contained in:
parent
aef56159a8
commit
73ea191a05
1 changed files with 4 additions and 1 deletions
|
@ -79,12 +79,15 @@ void TabWidget::set_active_widget(Widget* widget)
|
|||
if (widget == m_active_widget)
|
||||
return;
|
||||
|
||||
bool had_focus = is_focused() || (m_active_widget && m_active_widget->is_focused());
|
||||
|
||||
if (m_active_widget)
|
||||
m_active_widget->set_visible(false);
|
||||
m_active_widget = widget;
|
||||
if (m_active_widget) {
|
||||
m_active_widget->set_relative_rect(child_rect_for_size(size()));
|
||||
m_active_widget->set_focus(true);
|
||||
if (had_focus)
|
||||
m_active_widget->set_focus(true);
|
||||
m_active_widget->set_visible(true);
|
||||
deferred_invoke([this](auto&) {
|
||||
if (on_change)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue