From 544636fd0fa39955f2fae85e6932bb636ce60eb8 Mon Sep 17 00:00:00 2001 From: FrHun <28605587+frhun@users.noreply.github.com> Date: Mon, 4 Jul 2022 05:41:06 +0200 Subject: [PATCH] LibGUI: Notify the layout system of more relevant events in TabWidget --- Userland/Libraries/LibGUI/TabWidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 03833486b2..f945390842 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -57,6 +57,7 @@ ErrorOr 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(); }