Преглед изворни кода

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

FrHun пре 3 година
родитељ
комит
544636fd0f
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      Userland/Libraries/LibGUI/TabWidget.cpp

+ 8 - 0
Userland/Libraries/LibGUI/TabWidget.cpp

@@ -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();
 }
 }