mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibGUI: Add helper for constructing new TabWidget tabs
This patch adds the following convenience helper: auto tab_widget = GUI::TabWidget::construct(); auto my_widget = tab_widget->add_tab<GUI::Widget>("My tab", ...); The above is equivalent to: auto tab_widget = GUI::TabWidget::construct(); auto my_widget = GUI::Widget::construct(...); tab_widget->add_widget("My tab", my_widget);
This commit is contained in:
parent
bbc02af090
commit
6c5100b644
8 changed files with 42 additions and 53 deletions
|
@ -54,11 +54,10 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
|||
|
||||
auto tab_widget = main_widget->add<GUI::TabWidget>();
|
||||
|
||||
auto general_tab = tab_widget->add<GUI::Widget>();
|
||||
auto general_tab = tab_widget->add_tab<GUI::Widget>("General");
|
||||
general_tab->set_layout(make<GUI::VerticalBoxLayout>());
|
||||
general_tab->layout()->set_margins({ 12, 8, 12, 8 });
|
||||
general_tab->layout()->set_spacing(10);
|
||||
tab_widget->add_widget("General", general_tab);
|
||||
|
||||
general_tab->layout()->add_spacer();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue