1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Userland: Use non-fallible EventReceiver::add() where possible

This commit is contained in:
Tim Ledbetter 2023-09-22 22:28:59 +01:00 committed by Andreas Kling
parent 707ca984bd
commit b4e134cb52
54 changed files with 934 additions and 934 deletions

View file

@ -295,18 +295,18 @@ ErrorOr<GUI::Widget*> MoveTool::get_properties_widget()
auto properties_widget = GUI::Widget::construct();
properties_widget->set_layout<GUI::VerticalBoxLayout>();
auto selection_mode_container = TRY(properties_widget->try_add<GUI::Widget>());
selection_mode_container->set_layout<GUI::HorizontalBoxLayout>();
selection_mode_container->set_fixed_height(46);
auto selection_mode_label = TRY(selection_mode_container->try_add<GUI::Label>("Selection Mode:"_string));
selection_mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
selection_mode_label->set_fixed_size(80, 40);
auto& selection_mode_container = properties_widget->add<GUI::Widget>();
selection_mode_container.set_layout<GUI::HorizontalBoxLayout>();
selection_mode_container.set_fixed_height(46);
auto& selection_mode_label = selection_mode_container.add<GUI::Label>("Selection Mode:"_string);
selection_mode_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
selection_mode_label.set_fixed_size(80, 40);
auto mode_radio_container = TRY(selection_mode_container->try_add<GUI::Widget>());
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
m_selection_mode_foreground = TRY(mode_radio_container->try_add<GUI::RadioButton>("Foreground"_string));
auto& mode_radio_container = selection_mode_container.add<GUI::Widget>();
mode_radio_container.set_layout<GUI::VerticalBoxLayout>();
m_selection_mode_foreground = mode_radio_container.add<GUI::RadioButton>("Foreground"_string);
m_selection_mode_active = TRY(mode_radio_container->try_add<GUI::RadioButton>("Active Layer"_string));
m_selection_mode_active = mode_radio_container.add<GUI::RadioButton>("Active Layer"_string);
m_selection_mode_foreground->on_checked = [this](bool) {
m_layer_selection_mode = LayerSelectionMode::ForegroundLayer;