mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 17:55:08 +00:00
Userspace: Use Core::Object::add() when building interfaces
This commit is contained in:
parent
7ec758773c
commit
3d20da9ee4
87 changed files with 403 additions and 438 deletions
|
@ -62,17 +62,17 @@ int main(int argc, char** argv)
|
|||
widget->set_fill_with_background_color(true);
|
||||
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||
|
||||
auto board_combo = GUI::ComboBox::construct(widget);
|
||||
auto board_combo = widget->add<GUI::ComboBox>();
|
||||
board_combo->set_only_allow_values_from_model(true);
|
||||
board_combo->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||
board_combo->set_preferred_size(0, 20);
|
||||
board_combo->set_model(BoardListModel::create());
|
||||
|
||||
auto catalog_view = GUI::TableView::construct(widget);
|
||||
auto catalog_view = widget->add<GUI::TableView>();
|
||||
catalog_view->set_model(ThreadCatalogModel::create());
|
||||
auto& catalog_model = *static_cast<ThreadCatalogModel*>(catalog_view->model());
|
||||
|
||||
auto statusbar = GUI::StatusBar::construct(widget);
|
||||
auto statusbar = widget->add<GUI::StatusBar>();
|
||||
|
||||
board_combo->on_change = [&] (auto&, const GUI::ModelIndex& index) {
|
||||
auto selected_board = board_combo->model()->data(index, GUI::Model::Role::Custom);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue