1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28: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:
Andreas Kling 2023-08-13 14:52:36 +02:00
parent 341626e2ea
commit 8322b31b97
52 changed files with 127 additions and 135 deletions

View file

@ -293,17 +293,17 @@ ErrorOr<GUI::Widget*> MoveTool::get_properties_widget()
{
if (!m_properties_widget) {
auto properties_widget = TRY(GUI::Widget::try_create());
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
properties_widget->set_layout<GUI::VerticalBoxLayout>();
auto selection_mode_container = TRY(properties_widget->try_add<GUI::Widget>());
(void)TRY(selection_mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
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 mode_radio_container = TRY(selection_mode_container->try_add<GUI::Widget>());
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
m_selection_mode_foreground = TRY(mode_radio_container->try_add<GUI::RadioButton>("Foreground"_string));
m_selection_mode_active = TRY(mode_radio_container->try_add<GUI::RadioButton>("Active Layer"_string));