mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>(). Work towards #20557.
This commit is contained in:
parent
341626e2ea
commit
8322b31b97
52 changed files with 127 additions and 135 deletions
|
@ -152,11 +152,11 @@ ErrorOr<void> MessageBox::build()
|
|||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(8, 6));
|
||||
main_widget->set_layout<VerticalBoxLayout>(8, 6);
|
||||
|
||||
auto message_container = TRY(main_widget->try_add<Widget>());
|
||||
auto message_margins = Margins { 8, m_type != Type::None ? 8 : 0 };
|
||||
TRY(message_container->try_set_layout<HorizontalBoxLayout>(message_margins, 8));
|
||||
message_container->set_layout<HorizontalBoxLayout>(message_margins, 8);
|
||||
|
||||
if (auto icon = TRY(this->icon()); icon && m_type != Type::None) {
|
||||
auto image_widget = TRY(message_container->try_add<ImageWidget>());
|
||||
|
@ -170,7 +170,7 @@ ErrorOr<void> MessageBox::build()
|
|||
m_text_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(button_container->try_set_layout<HorizontalBoxLayout>(Margins {}, 8));
|
||||
button_container->set_layout<HorizontalBoxLayout>(Margins {}, 8);
|
||||
|
||||
auto add_button = [&](String text, ExecResult result) -> ErrorOr<NonnullRefPtr<Button>> {
|
||||
auto button = TRY(button_container->try_add<DialogButton>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue