1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Userland: Make Window::set_main_widget() non-fallible

This commit is contained in:
Tim Ledbetter 2023-09-19 01:13:48 +01:00 committed by Andreas Kling
parent c9297126db
commit 3aa49f268c
120 changed files with 144 additions and 133 deletions

View file

@ -27,7 +27,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
set_icon(parent_window->icon());
resize(200, 220);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->set_fill_with_background_color(true);
main_widget->set_layout<GUI::VerticalBoxLayout>(4);

View file

@ -20,7 +20,7 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win
set_icon(parent_window->icon());
resize(200, 200);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->set_fill_with_background_color(true);
main_widget->set_layout<GUI::VerticalBoxLayout>(4);

View file

@ -23,7 +23,7 @@ EditGuideDialog::EditGuideDialog(GUI::Window* parent_window, DeprecatedString co
resize(200, 130);
set_resizable(false);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->load_from_gml(edit_guide_dialog_gml).release_value_but_fixme_should_propagate_errors();
auto horizontal_radio = main_widget->find_descendant_of_type_named<GUI::RadioButton>("orientation_horizontal_radio");

View file

@ -21,7 +21,7 @@ FilterGallery::FilterGallery(GUI::Window* parent_window, ImageEditor* editor)
resize(400, 250);
set_resizable(true);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->load_from_gml(filter_gallery_gml).release_value_but_fixme_should_propagate_errors();
m_filter_tree = main_widget->find_descendant_of_type_named<GUI::TreeView>("tree_view");

View file

@ -48,7 +48,7 @@ private:
set_title(builder.string_view());
resize(200, 250);
auto main_widget = set_main_widget<GUI::Frame>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Frame>();
main_widget->set_frame_style(Gfx::FrameStyle::RaisedContainer);
main_widget->set_fill_with_background_color(true);
main_widget->template set_layout<GUI::VerticalBoxLayout>(4);

View file

@ -26,7 +26,7 @@ ImageMasking::ImageMasking(GUI::Window* parent_window, ImageEditor* editor, Mask
{
set_icon(parent_window->icon());
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
set_resizable(false);
m_previous_edit_mode = m_editor->active_layer()->edit_mode();

View file

@ -18,7 +18,7 @@ LevelsDialog::LevelsDialog(GUI::Window* parent_window, ImageEditor* editor)
set_title("Levels");
set_icon(parent_window->icon());
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->load_from_gml(levels_dialog_gml).release_value_but_fixme_should_propagate_errors();
resize(305, 202);

View file

@ -27,7 +27,7 @@ ResizeImageDialog::ResizeImageDialog(Gfx::IntSize suggested_size, GUI::Window* p
resize(260, 228);
set_icon(parent_window->icon());
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
auto main_widget = set_main_widget<GUI::Widget>();
main_widget->load_from_gml(resize_image_dialog_gml).release_value_but_fixme_should_propagate_errors();
auto width_spinbox = main_widget->find_descendant_of_type_named<GUI::SpinBox>("width_spinbox");

View file

@ -47,7 +47,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(800, 520);
window->set_icon(app_icon.bitmap_for_size(16));
auto main_widget = TRY(window->set_main_widget<PixelPaint::MainWidget>());
auto main_widget = window->set_main_widget<PixelPaint::MainWidget>();
TRY(main_widget->initialize_menubar(*window));