mirror of
https://github.com/RGBCube/serenity
synced 2025-06-15 18:22:09 +00:00
LibGUI: Remove TabWidget::try_add_tab()
This commit is contained in:
parent
ffda0785c0
commit
dc71ac4d2f
2 changed files with 2 additions and 12 deletions
|
@ -49,9 +49,8 @@ public:
|
||||||
template<class T, class... Args>
|
template<class T, class... Args>
|
||||||
ErrorOr<NonnullRefPtr<T>> add_tab(String title, StringView id, Args&&... 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)...));
|
auto tab = TRY(T::try_create(forward<Args>(args)...));
|
||||||
TRY(m_tabs.try_set(id, tab));
|
TRY(add_tab(tab, title, id));
|
||||||
tab->set_settings_window(*this);
|
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,15 +55,6 @@ public:
|
||||||
void add_widget(Widget&);
|
void add_widget(Widget&);
|
||||||
void remove_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>
|
template<class T, class... Args>
|
||||||
T& add_tab(String title, Args&&... args)
|
T& add_tab(String title, Args&&... args)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue