1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:37:35 +00:00

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