mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:27:45 +00:00
Userland: Use non-fallible EventReceiver::add()
where possible
This commit is contained in:
parent
707ca984bd
commit
b4e134cb52
54 changed files with 934 additions and 934 deletions
|
@ -15,7 +15,7 @@ GalleryWidget::GalleryWidget()
|
|||
auto& inner_widget = add<GUI::Widget>();
|
||||
inner_widget.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
m_tab_widget = inner_widget.try_add<GUI::TabWidget>().release_value_but_fixme_should_propagate_errors();
|
||||
m_tab_widget = inner_widget.add<GUI::TabWidget>();
|
||||
m_statusbar = add<GUI::Statusbar>();
|
||||
|
||||
(void)load_basic_model_tab();
|
||||
|
|
|
@ -89,12 +89,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
main_widget->set_fill_with_background_color(true);
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto icon_view = TRY(main_widget->try_add<GUI::IconView>());
|
||||
icon_view->set_should_hide_unnecessary_scrollbars(true);
|
||||
auto& icon_view = main_widget->add<GUI::IconView>();
|
||||
icon_view.set_should_hide_unnecessary_scrollbars(true);
|
||||
auto model = adopt_ref(*new ScreensaverAppsModel);
|
||||
icon_view->set_model(*model);
|
||||
icon_view.set_model(*model);
|
||||
|
||||
icon_view->on_activation = [&](GUI::ModelIndex const& index) {
|
||||
icon_view.on_activation = [&](GUI::ModelIndex const& index) {
|
||||
auto executable = model->data(index, GUI::ModelRole::Custom).as_string();
|
||||
GUI::Process::spawn_or_show_error(window, executable);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue