1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:38:13 +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

@ -469,13 +469,13 @@ ErrorOr<void> MainWidget::add_property_tab(PropertyTab const& property_tab)
properties_list->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8 }, 12);
for (auto const& group : property_tab.property_groups) {
NonnullRefPtr<GUI::GroupBox> group_box = TRY(properties_list->try_add<GUI::GroupBox>(group.title));
NonnullRefPtr<GUI::GroupBox> group_box = properties_list->add<GUI::GroupBox>(group.title);
// 1px less on the left makes the text line up with the group title.
group_box->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8, 8, 8, 7 }, 12);
group_box->set_preferred_height(GUI::SpecialDimension::Fit);
for (auto const& property : group.properties) {
NonnullRefPtr<GUI::Widget> row_widget = TRY(group_box->try_add<GUI::Widget>());
NonnullRefPtr<GUI::Widget> row_widget = group_box->add<GUI::Widget>();
row_widget->set_fixed_height(22);
TRY(property.role.visit(
[&](Gfx::AlignmentRole role) -> ErrorOr<void> {