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
|
@ -128,12 +128,12 @@ void InputBox::on_done(ExecResult result)
|
|||
ErrorOr<void> InputBox::build()
|
||||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(6, 6));
|
||||
main_widget->set_layout<VerticalBoxLayout>(6, 6);
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
|
||||
if (!m_prompt.is_empty()) {
|
||||
auto prompt_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(prompt_container->try_set_layout<HorizontalBoxLayout>(0, 8));
|
||||
prompt_container->set_layout<HorizontalBoxLayout>(0, 8);
|
||||
if (m_icon) {
|
||||
auto image_widget = TRY(prompt_container->try_add<ImageWidget>());
|
||||
image_widget->set_bitmap(m_icon);
|
||||
|
@ -158,7 +158,7 @@ ErrorOr<void> InputBox::build()
|
|||
}
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(button_container->try_set_layout<HorizontalBoxLayout>(0, 6));
|
||||
button_container->set_layout<HorizontalBoxLayout>(0, 6);
|
||||
TRY(button_container->add_spacer());
|
||||
|
||||
m_ok_button = TRY(button_container->try_add<DialogButton>("OK"_string));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue