LibGUI: When removing a TabWidget tab, activate the next tab
This commit is contained in:
parent
b0ca174d49
commit
5d88022252
Notes:
sideshowbarker
2024-07-19 07:20:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5d880222527
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)
|
||||
{
|
||||
if (active_widget() == &widget)
|
||||
activate_next_tab();
|
||||
m_tabs.remove_first_matching([&widget](auto& entry) { return &widget == entry.widget; });
|
||||
remove_child(widget);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue