1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:27:35 +00:00

LibGUI: Actually try something in TabWidget::try_add_widget(Widget&)

This function, while returning an `ErrorOr<void>`, didn't call failable
API.
This commit is contained in:
Lucas CHOLLET 2022-12-12 22:43:27 +01:00 committed by Linus Groh
parent 43ff500a80
commit 664117564a

View file

@ -53,8 +53,8 @@ TabWidget::TabWidget()
ErrorOr<void> TabWidget::try_add_widget(Widget& widget) ErrorOr<void> TabWidget::try_add_widget(Widget& widget)
{ {
m_tabs.append({ widget.title(), nullptr, &widget, false }); TRY(m_tabs.try_append({ widget.title(), nullptr, &widget, false }));
add_child(widget); TRY(try_add_child(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());