mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibGUI: Notify the layout system of more relevant events in TabWidget
This commit is contained in:
parent
ccdccadc24
commit
544636fd0f
Notes:
sideshowbarker
2024-07-17 09:44:10 +09:00
Author: https://github.com/frhun
Commit: 544636fd0f
Pull-request: https://github.com/SerenityOS/serenity/pull/14478
Issue: https://github.com/SerenityOS/serenity/issues/14420
1 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue