1
Fork 0
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:
Andreas Kling 2020-02-23 10:57:42 +01:00
parent 7ec758773c
commit 3d20da9ee4
87 changed files with 403 additions and 438 deletions

View file

@ -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);