LibGUI: Notify the layout system of more relevant events in TabWidget

This commit is contained in:
FrHun 2022-07-04 05:41:06 +02:00 committed by Andreas Kling
parent ccdccadc24
commit 544636fd0f

View file

@ -57,6 +57,7 @@ ErrorOr<void> TabWidget::try_add_widget(Widget& widget)
update_focus_policy();
if (on_tab_count_change)
on_tab_count_change(m_tabs.size());
layout_relevant_change_occured();
return {};
}
@ -82,6 +83,8 @@ void TabWidget::remove_widget(Widget& widget)
update_focus_policy();
if (on_tab_count_change)
on_tab_count_change(m_tabs.size());
layout_relevant_change_occured();
}
void TabWidget::remove_all_tabs_except(Widget& widget)
@ -98,6 +101,8 @@ void TabWidget::remove_all_tabs_except(Widget& widget)
update_focus_policy();
if (on_tab_count_change)
on_tab_count_change(1);
layout_relevant_change_occured();
}
void TabWidget::update_focus_policy()
@ -131,6 +136,8 @@ void TabWidget::set_active_widget(Widget* widget)
});
}
layout_relevant_change_occured();
update_bar();
}
@ -688,6 +695,7 @@ void TabWidget::doubleclick_event(MouseEvent& mouse_event)
void TabWidget::set_container_margins(GUI::Margins const& margins)
{
m_container_margins = margins;
layout_relevant_change_occured();
update();
}