mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:07:44 +00:00
LibGUI: When removing a TabWidget tab, activate the next tab
This commit is contained in:
parent
b0ca174d49
commit
5d88022252
1 changed files with 2 additions and 0 deletions
|
@ -49,6 +49,8 @@ void TabWidget::add_widget(const StringView& title, Widget& widget)
|
||||||
|
|
||||||
void TabWidget::remove_widget(Widget& widget)
|
void TabWidget::remove_widget(Widget& widget)
|
||||||
{
|
{
|
||||||
|
if (active_widget() == &widget)
|
||||||
|
activate_next_tab();
|
||||||
m_tabs.remove_first_matching([&widget](auto& entry) { return &widget == entry.widget; });
|
m_tabs.remove_first_matching([&widget](auto& entry) { return &widget == entry.widget; });
|
||||||
remove_child(widget);
|
remove_child(widget);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue