mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGUI: Remove TabWidget::try_add_tab()
This commit is contained in:
parent
ffda0785c0
commit
dc71ac4d2f
Notes:
sideshowbarker
2024-07-17 09:39:38 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/dc71ac4d2f Pull-request: https://github.com/SerenityOS/serenity/pull/21067 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/shannonbooth ✅
@ -49,9 +49,8 @@ public:
|
||||
template<class T, class... Args>
|
||||
ErrorOr<NonnullRefPtr<T>> add_tab(String title, StringView id, Args&&... args)
|
||||
{
|
||||
auto tab = TRY(m_tab_widget->try_add_tab<T>(move(title), forward<Args>(args)...));
|
||||
TRY(m_tabs.try_set(id, tab));
|
||||
tab->set_settings_window(*this);
|
||||
auto tab = TRY(T::try_create(forward<Args>(args)...));
|
||||
TRY(add_tab(tab, title, id));
|
||||
return tab;
|
||||
}
|
||||
|
||||
|
@ -55,15 +55,6 @@ public:
|
||||
void add_widget(Widget&);
|
||||
void remove_widget(Widget&);
|
||||
|
||||
template<class T, class... Args>
|
||||
ErrorOr<NonnullRefPtr<T>> try_add_tab(String title, Args&&... args)
|
||||
{
|
||||
auto t = TRY(T::try_create(forward<Args>(args)...));
|
||||
t->set_title(move(title));
|
||||
TRY(try_add_widget(*t));
|
||||
return *t;
|
||||
}
|
||||
|
||||
template<class T, class... Args>
|
||||
T& add_tab(String title, Args&&... args)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user