Serenity Operating System

Userland: Specify margins and spacing in the GUI::Layout constructor

authored by

Sam Atkins and committed by
Sam Atkins
77ad0fdb 9561ec15

+136 -288
+1 -2
Base/res/devel/templates/serenity-application/main.cpp
··· 23 23 auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); 24 24 main_widget->set_fill_with_background_color(true); 25 25 26 - auto layout = TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>()); 27 - layout->set_margins(16); 26 + (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(16)); 28 27 29 28 auto button = TRY(main_widget->try_add<GUI::Button>("Click me!")); 30 29 button->on_click = [&](auto) {
+1 -3
Userland/Applets/Audio/main.cpp
··· 82 82 83 83 m_root_container = TRY(m_slider_window->set_main_widget<GUI::Frame>()); 84 84 m_root_container->set_fill_with_background_color(true); 85 - m_root_container->set_layout<GUI::VerticalBoxLayout>(); 86 - m_root_container->layout()->set_margins({ 4 }); 87 - m_root_container->layout()->set_spacing(0); 85 + m_root_container->set_layout<GUI::VerticalBoxLayout>(4, 0); 88 86 m_root_container->set_frame_shape(Gfx::FrameShape::Window); 89 87 90 88 m_percent_box = m_root_container->add<GUI::CheckBox>(String::from_utf8_short_string("\xE2\x84\xB9"sv));
+3 -4
Userland/Applications/Assistant/main.cpp
··· 182 182 auto container = TRY(window->set_main_widget<GUI::Frame>()); 183 183 container->set_fill_with_background_color(true); 184 184 container->set_frame_shape(Gfx::FrameShape::Window); 185 - auto& layout = container->set_layout<GUI::VerticalBoxLayout>(); 186 - layout.set_margins({ 8 }); 185 + container->set_layout<GUI::VerticalBoxLayout>(8); 187 186 188 187 auto& text_box = container->add<GUI::TextBox>(); 189 188 auto& results_container = container->add<GUI::Widget>(); 190 - auto& results_layout = results_container.set_layout<GUI::VerticalBoxLayout>(); 189 + results_container.set_layout<GUI::VerticalBoxLayout>(); 191 190 192 191 auto mark_selected_item = [&]() { 193 192 for (size_t i = 0; i < app_state.visible_result_count; ++i) { ··· 250 249 251 250 auto update_ui_timer = TRY(Core::Timer::create_single_shot(10, [&] { 252 251 results_container.remove_all_children(); 253 - results_layout.set_margins(app_state.visible_result_count ? GUI::Margins { 4, 0, 0, 0 } : GUI::Margins { 0 }); 252 + results_container.layout()->set_margins(app_state.visible_result_count ? GUI::Margins { 4, 0, 0, 0 } : GUI::Margins { 0 }); 254 253 255 254 for (size_t i = 0; i < app_state.visible_result_count; ++i) { 256 255 auto& result = app_state.results[i];
+1 -3
Userland/Applications/Browser/BookmarksBarWidget.cpp
··· 103 103 BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, bool enabled) 104 104 { 105 105 s_the = this; 106 - set_layout<GUI::HorizontalBoxLayout>(); 107 - layout()->set_spacing(0); 108 - layout()->set_margins(2); 106 + set_layout<GUI::HorizontalBoxLayout>(2, 0); 109 107 110 108 set_fixed_height(20); 111 109
+1 -2
Userland/Applications/Browser/DownloadWidget.cpp
··· 59 59 m_download->stream_into(*m_output_file_stream); 60 60 61 61 set_fill_with_background_color(true); 62 - auto& layout = set_layout<GUI::VerticalBoxLayout>(); 63 - layout.set_margins(4); 62 + set_layout<GUI::VerticalBoxLayout>(4); 64 63 65 64 auto& animation_container = add<GUI::Widget>(); 66 65 animation_container.set_fixed_height(32);
+7 -14
Userland/Applications/Browser/InspectorWidget.cpp
··· 77 77 { 78 78 set_fill_with_background_color(true); 79 79 80 - auto& layout = set_layout<GUI::VerticalBoxLayout>(); 81 - layout.set_margins({ 4, 4, 4, 4 }); 80 + set_layout<GUI::VerticalBoxLayout>(4); 82 81 auto& splitter = add<GUI::VerticalSplitter>(); 83 82 84 83 auto& top_tab_widget = splitter.add<GUI::TabWidget>(); 85 84 86 85 auto& dom_tree_container = top_tab_widget.add_tab<GUI::Widget>("DOM"); 87 - dom_tree_container.set_layout<GUI::VerticalBoxLayout>(); 88 - dom_tree_container.layout()->set_margins({ 4, 4, 4, 4 }); 86 + dom_tree_container.set_layout<GUI::VerticalBoxLayout>(4); 89 87 m_dom_tree_view = dom_tree_container.add<GUI::TreeView>(); 90 88 m_dom_tree_view->on_selection_change = [this] { 91 89 const auto& index = m_dom_tree_view->selection().first(); ··· 93 91 }; 94 92 95 93 auto& accessibility_tree_container = top_tab_widget.add_tab<GUI::Widget>("Accessibility"); 96 - accessibility_tree_container.set_layout<GUI::VerticalBoxLayout>(); 97 - accessibility_tree_container.layout()->set_margins({ 4, 4, 4, 4 }); 94 + accessibility_tree_container.set_layout<GUI::VerticalBoxLayout>(4); 98 95 m_accessibility_tree_view = accessibility_tree_container.add<GUI::TreeView>(); 99 96 100 97 auto& bottom_tab_widget = splitter.add<GUI::TabWidget>(); 101 98 102 99 auto& computed_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Computed"); 103 - computed_style_table_container.set_layout<GUI::VerticalBoxLayout>(); 104 - computed_style_table_container.layout()->set_margins({ 4, 4, 4, 4 }); 100 + computed_style_table_container.set_layout<GUI::VerticalBoxLayout>(4); 105 101 m_computed_style_table_view = computed_style_table_container.add<GUI::TableView>(); 106 102 107 103 auto& resolved_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Resolved"); 108 - resolved_style_table_container.set_layout<GUI::VerticalBoxLayout>(); 109 - resolved_style_table_container.layout()->set_margins({ 4, 4, 4, 4 }); 104 + resolved_style_table_container.set_layout<GUI::VerticalBoxLayout>(4); 110 105 m_resolved_style_table_view = resolved_style_table_container.add<GUI::TableView>(); 111 106 112 107 auto& custom_properties_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Variables"); 113 - custom_properties_table_container.set_layout<GUI::VerticalBoxLayout>(); 114 - custom_properties_table_container.layout()->set_margins({ 4, 4, 4, 4 }); 108 + custom_properties_table_container.set_layout<GUI::VerticalBoxLayout>(4); 115 109 m_custom_properties_table_view = custom_properties_table_container.add<GUI::TableView>(); 116 110 117 111 auto& box_model_widget = bottom_tab_widget.add_tab<GUI::Widget>("Box Model"); 118 - box_model_widget.set_layout<GUI::VerticalBoxLayout>(); 119 - box_model_widget.layout()->set_margins({ 4, 4, 4, 4 }); 112 + box_model_widget.set_layout<GUI::VerticalBoxLayout>(4); 120 113 m_element_size_view = box_model_widget.add<ElementSizePreviewWidget>(); 121 114 m_element_size_view->set_should_hide_unnecessary_scrollbars(true); 122 115
+3 -6
Userland/Applications/Calendar/AddEventDialog.cpp
··· 33 33 widget->set_layout<GUI::VerticalBoxLayout>(); 34 34 35 35 auto& top_container = widget->add<GUI::Widget>(); 36 - top_container.set_layout<GUI::VerticalBoxLayout>(); 36 + top_container.set_layout<GUI::VerticalBoxLayout>(4); 37 37 top_container.set_fixed_height(45); 38 - top_container.layout()->set_margins(4); 39 38 40 39 auto& add_label = top_container.add<GUI::Label>("Add title & date:"); 41 40 add_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 46 45 event_title_textbox.set_fixed_height(20); 47 46 48 47 auto& middle_container = widget->add<GUI::Widget>(); 49 - middle_container.set_layout<GUI::HorizontalBoxLayout>(); 48 + middle_container.set_layout<GUI::HorizontalBoxLayout>(4); 50 49 middle_container.set_fixed_height(25); 51 - middle_container.layout()->set_margins(4); 52 50 53 51 auto& time_container = widget->add<GUI::Widget>(); 54 - time_container.set_layout<GUI::HorizontalBoxLayout>(); 52 + time_container.set_layout<GUI::HorizontalBoxLayout>(4); 55 53 time_container.set_fixed_height(25); 56 - time_container.layout()->set_margins(4); 57 54 58 55 auto& starting_month_combo = middle_container.add<GUI::ComboBox>(); 59 56 starting_month_combo.set_only_allow_values_from_model(true);
+6 -12
Userland/Applications/CrashReporter/main.cpp
··· 216 216 auto& tab_widget = *widget->find_descendant_of_type_named<GUI::TabWidget>("tab_widget"); 217 217 218 218 auto backtrace_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Backtrace")); 219 - (void)TRY(backtrace_tab->try_set_layout<GUI::VerticalBoxLayout>()); 220 - backtrace_tab->layout()->set_margins(4); 219 + (void)TRY(backtrace_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 221 220 222 221 auto backtrace_label = TRY(backtrace_tab->try_add<GUI::Label>("A backtrace for each thread alive during the crash is listed below:")); 223 222 backtrace_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 227 226 backtrace_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom); 228 227 229 228 auto cpu_registers_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("CPU Registers")); 230 - cpu_registers_tab->set_layout<GUI::VerticalBoxLayout>(); 231 - cpu_registers_tab->layout()->set_margins(4); 229 + cpu_registers_tab->set_layout<GUI::VerticalBoxLayout>(4); 232 230 233 231 auto cpu_registers_label = TRY(cpu_registers_tab->try_add<GUI::Label>("The CPU register state for each thread alive during the crash is listed below:")); 234 232 cpu_registers_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 238 236 cpu_registers_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom); 239 237 240 238 auto environment_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Environment")); 241 - (void)TRY(environment_tab->try_set_layout<GUI::VerticalBoxLayout>()); 242 - environment_tab->layout()->set_margins(4); 239 + (void)TRY(environment_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 243 240 244 241 auto environment_text_editor = TRY(environment_tab->try_add<GUI::TextEditor>()); 245 242 environment_text_editor->set_text(DeprecatedString::join('\n', environment)); ··· 248 245 environment_text_editor->set_should_hide_unnecessary_scrollbars(true); 249 246 250 247 auto memory_regions_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Memory Regions")); 251 - (void)TRY(memory_regions_tab->try_set_layout<GUI::VerticalBoxLayout>()); 252 - memory_regions_tab->layout()->set_margins(4); 248 + (void)TRY(memory_regions_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 253 249 254 250 auto memory_regions_text_editor = TRY(memory_regions_tab->try_add<GUI::TextEditor>()); 255 251 memory_regions_text_editor->set_text(DeprecatedString::join('\n', memory_regions)); ··· 307 303 [&](auto results) -> ErrorOr<void> { 308 304 for (auto& backtrace : results.thread_backtraces) { 309 305 auto container = TRY(backtrace_tab_widget->try_add_tab<GUI::Widget>(backtrace.title)); 310 - (void)TRY(container->template try_set_layout<GUI::VerticalBoxLayout>()); 311 - container->layout()->set_margins(4); 306 + (void)TRY(container->template try_set_layout<GUI::VerticalBoxLayout>(4)); 312 307 auto backtrace_text_editor = TRY(container->template try_add<GUI::TextEditor>()); 313 308 backtrace_text_editor->set_text(backtrace.text); 314 309 backtrace_text_editor->set_mode(GUI::TextEditor::Mode::ReadOnly); ··· 319 314 320 315 for (auto& cpu_registers : results.thread_cpu_registers) { 321 316 auto container = TRY(cpu_registers_tab_widget->try_add_tab<GUI::Widget>(cpu_registers.title)); 322 - (void)TRY(container->template try_set_layout<GUI::VerticalBoxLayout>()); 323 - container->layout()->set_margins(4); 317 + (void)TRY(container->template try_set_layout<GUI::VerticalBoxLayout>(4)); 324 318 auto cpu_registers_text_editor = TRY(container->template try_add<GUI::TextEditor>()); 325 319 cpu_registers_text_editor->set_text(cpu_registers.text); 326 320 cpu_registers_text_editor->set_mode(GUI::TextEditor::Mode::ReadOnly);
+2 -5
Userland/Applications/FileManager/PropertiesWindow.cpp
··· 53 53 ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename) 54 54 { 55 55 auto main_widget = TRY(set_main_widget<GUI::Widget>()); 56 - (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>()); 57 - main_widget->layout()->set_spacing(6); 58 - main_widget->layout()->set_margins(4); 56 + (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6)); 59 57 main_widget->set_fill_with_background_color(true); 60 58 61 59 auto tab_widget = TRY(main_widget->try_add<GUI::TabWidget>()); ··· 151 149 TRY(setup_permission_checkboxes(*others_read, *others_write, *others_execute, { S_IROTH, S_IWOTH, S_IXOTH }, m_mode)); 152 150 153 151 auto button_widget = TRY(main_widget->try_add<GUI::Widget>()); 154 - (void)TRY(button_widget->try_set_layout<GUI::HorizontalBoxLayout>()); 152 + (void)TRY(button_widget->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5)); 155 153 button_widget->set_fixed_height(22); 156 - button_widget->layout()->set_spacing(5); 157 154 158 155 TRY(button_widget->add_spacer()); 159 156
+1 -2
Userland/Applications/ImageViewer/MainWidget.cpp
··· 11 11 MainWidget::MainWidget() 12 12 { 13 13 set_fill_with_background_color(true); 14 - set_layout<GUI::VerticalBoxLayout>(); 15 - layout()->set_spacing(2); 14 + set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 2); 16 15 } 17 16 18 17 void MainWidget::keydown_event(GUI::KeyEvent& event)
+1 -2
Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp
··· 39 39 void KeyboardMapperWidget::create_frame() 40 40 { 41 41 set_fill_with_background_color(true); 42 - set_layout<GUI::VerticalBoxLayout>(); 43 - layout()->set_margins(4); 42 + set_layout<GUI::VerticalBoxLayout>(4); 44 43 45 44 auto& main_widget = add<GUI::Widget>(); 46 45 main_widget.set_relative_rect(0, 0, 200, 200);
+2 -4
Userland/Applications/PDFViewer/SidebarWidget.cpp
··· 18 18 auto& tab_bar = add<GUI::TabWidget>(); 19 19 20 20 auto& outline_container = tab_bar.add_tab<GUI::Widget>("Outline"); 21 - outline_container.set_layout<GUI::VerticalBoxLayout>(); 22 - outline_container.layout()->set_margins(4); 21 + outline_container.set_layout<GUI::VerticalBoxLayout>(4); 23 22 24 23 m_outline_tree_view = outline_container.add<GUI::TreeView>(); 25 24 m_outline_tree_view->set_activates_on_selection(true); ··· 34 33 }; 35 34 36 35 auto& thumbnails_container = tab_bar.add_tab<GUI::Widget>("Thumbnails"); 37 - thumbnails_container.set_layout<GUI::VerticalBoxLayout>(); 38 - thumbnails_container.layout()->set_margins(4); 36 + thumbnails_container.set_layout<GUI::VerticalBoxLayout>(4); 39 37 40 38 // FIXME: Add thumbnail previews 41 39 }
+2 -5
Userland/Applications/Piano/MainWidget.cpp
··· 34 34 35 35 ErrorOr<void> MainWidget::initialize() 36 36 { 37 - (void)TRY(try_set_layout<GUI::VerticalBoxLayout>()); 38 - layout()->set_spacing(2); 39 - layout()->set_margins(2); 37 + (void)TRY(try_set_layout<GUI::VerticalBoxLayout>(2, 2)); 40 38 set_fill_with_background_color(true); 41 39 42 40 m_wave_widget = TRY(try_add<WaveWidget>(m_track_manager)); ··· 51 49 m_player_widget = TRY(try_add<PlayerWidget>(m_track_manager, m_audio_loop)); 52 50 53 51 m_keys_and_knobs_container = TRY(try_add<GUI::Widget>()); 54 - (void)TRY(m_keys_and_knobs_container->try_set_layout<GUI::HorizontalBoxLayout>()); 55 - m_keys_and_knobs_container->layout()->set_spacing(2); 52 + (void)TRY(m_keys_and_knobs_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 2)); 56 53 m_keys_and_knobs_container->set_fixed_height(130); 57 54 m_keys_and_knobs_container->set_fill_with_background_color(true); 58 55
+2 -5
Userland/Applications/Piano/SamplerWidget.cpp
··· 40 40 SamplerWidget::SamplerWidget(TrackManager& track_manager) 41 41 : m_track_manager(track_manager) 42 42 { 43 - set_layout<GUI::VerticalBoxLayout>(); 44 - layout()->set_margins(10); 45 - layout()->set_spacing(10); 43 + set_layout<GUI::VerticalBoxLayout>(10, 10); 46 44 set_fill_with_background_color(true); 47 45 48 46 m_open_button_and_recorded_sample_name_container = add<GUI::Widget>(); 49 - m_open_button_and_recorded_sample_name_container->set_layout<GUI::HorizontalBoxLayout>(); 50 - m_open_button_and_recorded_sample_name_container->layout()->set_spacing(10); 47 + m_open_button_and_recorded_sample_name_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 10); 51 48 m_open_button_and_recorded_sample_name_container->set_fixed_height(24); 52 49 53 50 m_open_button = m_open_button_and_recorded_sample_name_container->add<GUI::Button>();
+1 -2
Userland/Applications/PixelPaint/CreateNewImageDialog.cpp
··· 30 30 auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 31 31 main_widget->set_fill_with_background_color(true); 32 32 33 - auto& layout = main_widget->set_layout<GUI::VerticalBoxLayout>(); 34 - layout.set_margins(4); 33 + main_widget->set_layout<GUI::VerticalBoxLayout>(4); 35 34 36 35 auto& name_label = main_widget->add<GUI::Label>("Name:"); 37 36 name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
+1 -3
Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp
··· 22 22 23 23 auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 24 24 main_widget->set_fill_with_background_color(true); 25 - 26 - auto& layout = main_widget->set_layout<GUI::VerticalBoxLayout>(); 27 - layout.set_margins(4); 25 + main_widget->set_layout<GUI::VerticalBoxLayout>(4); 28 26 29 27 auto& name_label = main_widget->add<GUI::Label>("Name:"); 30 28 name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
+1 -2
Userland/Applications/PixelPaint/FilterParams.h
··· 52 52 main_widget->set_frame_shape(Gfx::FrameShape::Container); 53 53 main_widget->set_frame_shadow(Gfx::FrameShadow::Raised); 54 54 main_widget->set_fill_with_background_color(true); 55 - auto& layout = main_widget->template set_layout<GUI::VerticalBoxLayout>(); 56 - layout.set_margins(4); 55 + main_widget->template set_layout<GUI::VerticalBoxLayout>(4); 57 56 58 57 size_t index = 0; 59 58 size_t columns = N;
+2 -4
Userland/Applications/PixelPaint/Filters/Bloom.cpp
··· 47 47 48 48 auto luma_lower_container = TRY(settings_widget->try_add<GUI::Widget>()); 49 49 luma_lower_container->set_fixed_height(50); 50 - auto luma_lower_container_layout = TRY(luma_lower_container->try_set_layout<GUI::VerticalBoxLayout>()); 51 - luma_lower_container_layout->set_margins({ 4, 0, 4, 0 }); 50 + (void)TRY(luma_lower_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 52 51 53 52 auto luma_lower_label = TRY(luma_lower_container->try_add<GUI::Label>("Luma lower bound:")); 54 53 luma_lower_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 64 63 65 64 auto radius_container = TRY(settings_widget->try_add<GUI::Widget>()); 66 65 radius_container->set_fixed_height(50); 67 - auto radius_container_layout = TRY(radius_container->try_set_layout<GUI::VerticalBoxLayout>()); 68 - radius_container_layout->set_margins({ 4, 0, 4, 0 }); 66 + (void)TRY(radius_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 69 67 70 68 auto radius_label = TRY(radius_container->try_add<GUI::Label>("Blur Radius:")); 71 69 radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
+4 -8
Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp
··· 86 86 87 87 m_radius_container = TRY(settings_widget->try_add<GUI::Widget>()); 88 88 m_radius_container->set_fixed_height(20); 89 - auto radius_container_layout = TRY(m_radius_container->try_set_layout<GUI::HorizontalBoxLayout>()); 90 - radius_container_layout->set_margins({ 4, 0, 4, 0 }); 89 + (void)TRY(m_radius_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 91 90 92 91 auto radius_label = TRY(m_radius_container->try_add<GUI::Label>("Radius:")); 93 92 radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 104 103 m_asymmetric_radius_container = TRY(settings_widget->try_add<GUI::Widget>()); 105 104 m_asymmetric_radius_container->set_visible(false); 106 105 m_asymmetric_radius_container->set_fixed_height(50); 107 - auto asymmetric_radius_container_label = TRY(m_asymmetric_radius_container->try_set_layout<GUI::VerticalBoxLayout>()); 108 - asymmetric_radius_container_label->set_margins({ 4, 0, 4, 0 }); 106 + (void)TRY(m_asymmetric_radius_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 109 107 110 108 auto radius_x_container = TRY(m_asymmetric_radius_container->try_add<GUI::Widget>()); 111 109 radius_x_container->set_fixed_height(20); ··· 142 140 m_vector_container = TRY(settings_widget->try_add<GUI::Widget>()); 143 141 m_vector_container->set_visible(false); 144 142 m_vector_container->set_fixed_height(50); 145 - auto vector_container_layout = TRY(m_vector_container->try_set_layout<GUI::VerticalBoxLayout>()); 146 - vector_container_layout->set_margins({ 4, 0, 4, 0 }); 143 + (void)TRY(m_vector_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 147 144 148 145 auto angle_container = TRY(m_vector_container->try_add<GUI::Widget>()); 149 146 angle_container->set_fixed_height(20); ··· 179 176 180 177 auto gaussian_container = TRY(settings_widget->try_add<GUI::Widget>()); 181 178 gaussian_container->set_fixed_height(20); 182 - auto gaussian_container_layout = TRY(gaussian_container->try_set_layout<GUI::HorizontalBoxLayout>()); 183 - gaussian_container_layout->set_margins({ 4, 0, 4, 0 }); 179 + (void)TRY(gaussian_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 184 180 185 181 m_gaussian_checkbox = TRY(gaussian_container->try_add<GUI::CheckBox>(TRY(String::from_utf8("Approximate Gaussian Blur"sv)))); 186 182 m_gaussian_checkbox->set_checked(m_approximate_gauss);
+1 -2
Userland/Applications/PixelPaint/Filters/Sepia.cpp
··· 30 30 31 31 auto amount_container = TRY(settings_widget->try_add<GUI::Widget>()); 32 32 amount_container->set_fixed_height(20); 33 - auto amount_layout = TRY(amount_container->try_set_layout<GUI::HorizontalBoxLayout>()); 34 - amount_layout->set_margins({ 4, 0, 4, 0 }); 33 + (void)TRY(amount_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 })); 35 34 36 35 auto amount_label = TRY(amount_container->try_add<GUI::Label>("Amount:")); 37 36 amount_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
+1 -3
Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp
··· 24 24 set_layout<GUI::VerticalBoxLayout>(); 25 25 26 26 auto& group_box = add<GUI::GroupBox>("Layer properties"sv); 27 - auto& layout = group_box.set_layout<GUI::VerticalBoxLayout>(); 28 - 29 - layout.set_margins({ 8 }); 27 + group_box.set_layout<GUI::VerticalBoxLayout>(8); 30 28 31 29 auto& name_container = group_box.add<GUI::Widget>(); 32 30 name_container.set_fixed_height(20);
+3 -6
Userland/Applications/PixelPaint/PaletteWidget.cpp
··· 118 118 119 119 m_color_container = add<GUI::Widget>(); 120 120 m_color_container->set_relative_rect(m_secondary_color_widget->relative_rect().right() + 2, 2, 500, 33); 121 - m_color_container->set_layout<GUI::VerticalBoxLayout>(); 122 - m_color_container->layout()->set_spacing(1); 121 + m_color_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 1); 123 122 124 123 auto& top_color_container = m_color_container->add<GUI::Widget>(); 125 124 top_color_container.set_name("top_color_container"); 126 - top_color_container.set_layout<GUI::HorizontalBoxLayout>(); 127 - top_color_container.layout()->set_spacing(1); 125 + top_color_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 1); 128 126 129 127 auto& bottom_color_container = m_color_container->add<GUI::Widget>(); 130 128 bottom_color_container.set_name("bottom_color_container"); 131 - bottom_color_container.set_layout<GUI::HorizontalBoxLayout>(); 132 - bottom_color_container.layout()->set_spacing(1); 129 + bottom_color_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 1); 133 130 134 131 auto result = load_palette_path("/res/color-palettes/default.palette"); 135 132 if (result.is_error()) {
+1 -2
Userland/Applications/PixelPaint/ToolPropertiesWidget.cpp
··· 20 20 set_layout<GUI::VerticalBoxLayout>(); 21 21 22 22 m_group_box = add<GUI::GroupBox>("Tool properties"sv); 23 - auto& layout = m_group_box->set_layout<GUI::VerticalBoxLayout>(); 24 - layout.set_margins({ 8 }); 23 + m_group_box->set_layout<GUI::VerticalBoxLayout>(8); 25 24 m_tool_widget_stack = m_group_box->add<GUI::StackWidget>(); 26 25 m_blank_widget = m_tool_widget_stack->add<GUI::Widget>(); 27 26 m_error_label = m_tool_widget_stack->add<GUI::Label>();
+1 -4
Userland/Applications/PixelPaint/ToolboxWidget.cpp
··· 39 39 set_fill_with_background_color(true); 40 40 41 41 set_fixed_width(26); 42 - 43 - set_layout<GUI::VerticalBoxLayout>(); 44 - layout()->set_spacing(0); 45 - layout()->set_margins(2); 42 + set_layout<GUI::VerticalBoxLayout>(2, 0); 46 43 47 44 m_action_group.set_exclusive(true); 48 45 m_action_group.set_unchecking_allowed(false);
+10 -17
Userland/Applications/Spreadsheet/CellTypeDialog.cpp
··· 46 46 resize(285, 360); 47 47 48 48 auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 49 - main_widget->set_layout<GUI::VerticalBoxLayout>().set_margins(4); 49 + main_widget->set_layout<GUI::VerticalBoxLayout>(4); 50 50 main_widget->set_fill_with_background_color(true); 51 51 52 52 auto& tab_widget = main_widget->add<GUI::TabWidget>(); ··· 54 54 55 55 auto& buttonbox = main_widget->add<GUI::Widget>(); 56 56 buttonbox.set_shrink_to_fit(true); 57 - auto& button_layout = buttonbox.set_layout<GUI::HorizontalBoxLayout>(); 58 - button_layout.set_spacing(10); 57 + buttonbox.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 10); 59 58 buttonbox.add_spacer().release_value_but_fixme_should_propagate_errors(); 60 59 auto& ok_button = buttonbox.add<GUI::Button>(String::from_utf8_short_string("OK"sv)); 61 60 ok_button.set_fixed_width(80); ··· 134 133 } 135 134 136 135 auto& type_tab = tabs.add_tab<GUI::Widget>("Type"); 137 - type_tab.set_layout<GUI::HorizontalBoxLayout>().set_margins(4); 136 + type_tab.set_layout<GUI::HorizontalBoxLayout>(4); 138 137 { 139 138 auto& left_side = type_tab.add<GUI::Widget>(); 140 139 left_side.set_layout<GUI::VerticalBoxLayout>(); ··· 199 198 } 200 199 201 200 auto& alignment_tab = tabs.add_tab<GUI::Widget>("Alignment"); 202 - alignment_tab.set_layout<GUI::VerticalBoxLayout>().set_margins(4); 201 + alignment_tab.set_layout<GUI::VerticalBoxLayout>(4); 203 202 { 204 203 // FIXME: Frame? 205 204 // Horizontal alignment 206 205 { 207 206 auto& horizontal_alignment_selection_container = alignment_tab.add<GUI::Widget>(); 208 - horizontal_alignment_selection_container.set_layout<GUI::HorizontalBoxLayout>(); 209 - horizontal_alignment_selection_container.layout()->set_margins({ 4, 0, 0 }); 207 + horizontal_alignment_selection_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 }); 210 208 horizontal_alignment_selection_container.set_fixed_height(22); 211 209 212 210 auto& horizontal_alignment_label = horizontal_alignment_selection_container.add<GUI::Label>(); ··· 237 235 // Vertical alignment 238 236 { 239 237 auto& vertical_alignment_container = alignment_tab.add<GUI::Widget>(); 240 - vertical_alignment_container.set_layout<GUI::HorizontalBoxLayout>(); 241 - vertical_alignment_container.layout()->set_margins({ 4, 0, 0 }); 238 + vertical_alignment_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 }); 242 239 vertical_alignment_container.set_fixed_height(22); 243 240 244 241 auto& vertical_alignment_label = vertical_alignment_container.add<GUI::Label>(); ··· 268 265 } 269 266 270 267 auto& colors_tab = tabs.add_tab<GUI::Widget>("Color"); 271 - colors_tab.set_layout<GUI::VerticalBoxLayout>().set_margins(4); 268 + colors_tab.set_layout<GUI::VerticalBoxLayout>(4); 272 269 { 273 270 // Static formatting 274 271 { ··· 279 276 { 280 277 // FIXME: Somehow allow unsetting these. 281 278 auto& foreground_container = static_formatting_container.add<GUI::Widget>(); 282 - foreground_container.set_layout<GUI::HorizontalBoxLayout>(); 283 - foreground_container.layout()->set_margins({ 4, 0, 0 }); 279 + foreground_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 }); 284 280 foreground_container.set_preferred_height(GUI::SpecialDimension::Fit); 285 281 286 282 auto& foreground_label = foreground_container.add<GUI::Label>(); ··· 299 295 { 300 296 // FIXME: Somehow allow unsetting these. 301 297 auto& background_container = static_formatting_container.add<GUI::Widget>(); 302 - background_container.set_layout<GUI::HorizontalBoxLayout>(); 303 - background_container.layout()->set_margins({ 4, 0, 0 }); 298 + background_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 }); 304 299 background_container.set_preferred_height(GUI::SpecialDimension::Fit); 305 300 306 301 auto& background_label = background_container.add<GUI::Label>(); ··· 427 422 428 423 ConditionsView::ConditionsView() 429 424 { 430 - auto& layout = set_layout<GUI::VerticalBoxLayout>(); 431 - layout.set_spacing(4); 432 - layout.set_margins({ 6 }); 425 + set_layout<GUI::VerticalBoxLayout>(6, 4); 433 426 } 434 427 435 428 void ConditionsView::set_formats(Vector<ConditionalFormat>* formats)
+1 -1
Userland/Applications/Spreadsheet/SpreadsheetView.cpp
··· 305 305 : m_sheet(sheet) 306 306 , m_sheet_model(SheetModel::create(*m_sheet)) 307 307 { 308 - set_layout<GUI::VerticalBoxLayout>().set_margins(2); 308 + set_layout<GUI::VerticalBoxLayout>(2); 309 309 m_table_view = add<InfinitelyScrollableTableView>(); 310 310 m_table_view->set_grid_style(GUI::TableView::GridStyle::Both); 311 311 m_table_view->set_selection_behavior(GUI::AbstractView::SelectionBehavior::SelectItems);
+3 -3
Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp
··· 31 31 : m_workbook(make<Workbook>(move(sheets), parent_window)) 32 32 { 33 33 set_fill_with_background_color(true); 34 - set_layout<GUI::VerticalBoxLayout>().set_margins(2); 34 + set_layout<GUI::VerticalBoxLayout>(2); 35 35 36 36 auto& toolbar_container = add<GUI::ToolbarContainer>(); 37 37 auto& toolbar = toolbar_container.add<GUI::Toolbar>(); ··· 39 39 auto& container = add<GUI::VerticalSplitter>(); 40 40 41 41 auto& top_bar = container.add<GUI::Frame>(); 42 - top_bar.set_layout<GUI::HorizontalBoxLayout>().set_spacing(1); 42 + top_bar.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 1); 43 43 top_bar.set_preferred_height(26); 44 44 auto& current_cell_label = top_bar.add<GUI::Label>(""); 45 45 current_cell_label.set_fixed_width(50); ··· 83 83 m_inline_documentation_window->set_resizable(false); 84 84 auto inline_widget = m_inline_documentation_window->set_main_widget<GUI::Frame>().release_value_but_fixme_should_propagate_errors(); 85 85 inline_widget->set_fill_with_background_color(true); 86 - inline_widget->set_layout<GUI::VerticalBoxLayout>().set_margins(4); 86 + inline_widget->set_layout<GUI::VerticalBoxLayout>(4); 87 87 inline_widget->set_frame_shape(Gfx::FrameShape::Box); 88 88 m_inline_documentation_label = inline_widget->add<GUI::Label>(); 89 89 m_inline_documentation_label->set_fill_with_background_color(true);
+1 -3
Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp
··· 43 43 44 44 set_fixed_height(110); 45 45 46 - set_layout<GUI::VerticalBoxLayout>(); 47 - layout()->set_margins({ 8, 0, 0 }); 48 - layout()->set_spacing(3); 46 + set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8, 0, 0 }, 3); 49 47 50 48 auto build_widgets_for_label = [this](DeprecatedString const& description) -> RefPtr<GUI::Label> { 51 49 auto& container = add<GUI::Widget>();
+4 -8
Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp
··· 22 22 NetworkStatisticsWidget::NetworkStatisticsWidget() 23 23 { 24 24 on_first_show = [this](auto&) { 25 - set_layout<GUI::VerticalBoxLayout>(); 26 - layout()->set_margins(4); 25 + set_layout<GUI::VerticalBoxLayout>(4); 27 26 set_fill_with_background_color(true); 28 27 29 28 m_network_connected_bitmap = Gfx::Bitmap::load_from_file("/res/icons/16x16/network-connected.png"sv).release_value_but_fixme_should_propagate_errors(); ··· 38 37 } 39 38 40 39 auto& adapters_group_box = add<GUI::GroupBox>("Adapters"sv); 41 - adapters_group_box.set_layout<GUI::VerticalBoxLayout>(); 42 - adapters_group_box.layout()->set_margins(6); 40 + adapters_group_box.set_layout<GUI::VerticalBoxLayout>(6); 43 41 adapters_group_box.set_fixed_height(120); 44 42 45 43 m_adapter_table_view = adapters_group_box.add<GUI::TableView>(); ··· 94 92 }; 95 93 96 94 auto& tcp_sockets_group_box = add<GUI::GroupBox>("TCP Sockets"sv); 97 - tcp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>(); 98 - tcp_sockets_group_box.layout()->set_margins(6); 95 + tcp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>(6); 99 96 100 97 m_tcp_socket_table_view = tcp_sockets_group_box.add<GUI::TableView>(); 101 98 ··· 115 112 m_tcp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_tcp_socket_model))); 116 113 117 114 auto& udp_sockets_group_box = add<GUI::GroupBox>("UDP Sockets"sv); 118 - udp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>(); 119 - udp_sockets_group_box.layout()->set_margins(6); 115 + udp_sockets_group_box.set_layout<GUI::VerticalBoxLayout>(6); 120 116 121 117 m_udp_socket_table_view = udp_sockets_group_box.add<GUI::TableView>(); 122 118
+1 -2
Userland/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp
··· 17 17 18 18 ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget() 19 19 { 20 - set_layout<GUI::VerticalBoxLayout>(); 21 - layout()->set_margins(4); 20 + set_layout<GUI::VerticalBoxLayout>(4); 22 21 m_table_view = add<GUI::TableView>(); 23 22 24 23 Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields;
+1 -2
Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
··· 51 51 52 52 ProcessMemoryMapWidget::ProcessMemoryMapWidget() 53 53 { 54 - set_layout<GUI::VerticalBoxLayout>(); 55 - layout()->set_margins(4); 54 + set_layout<GUI::VerticalBoxLayout>(4); 56 55 m_table_view = add<GUI::TableView>(); 57 56 Vector<GUI::JsonArrayModel::FieldSpec> pid_vm_fields; 58 57 pid_vm_fields.empend(
+1 -2
Userland/Applications/SystemMonitor/ProcessStateWidget.cpp
··· 95 95 96 96 ProcessStateWidget::ProcessStateWidget() 97 97 { 98 - set_layout<GUI::VerticalBoxLayout>(); 99 - layout()->set_margins(4); 98 + set_layout<GUI::VerticalBoxLayout>(4); 100 99 m_table_view = add<GUI::TableView>(); 101 100 m_table_view->set_model(adopt_ref(*new ProcessStateModel(ProcessModel::the(), 0))); 102 101 m_table_view->column_header().set_visible(false);
+1 -2
Userland/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp
··· 18 18 19 19 ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget() 20 20 { 21 - set_layout<GUI::VerticalBoxLayout>(); 22 - layout()->set_margins(4); 21 + set_layout<GUI::VerticalBoxLayout>(4); 23 22 m_table_view = add<GUI::TableView>(); 24 23 25 24 Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields;
+1 -2
Userland/Applications/SystemMonitor/ThreadStackWidget.cpp
··· 73 73 74 74 ThreadStackWidget::ThreadStackWidget() 75 75 { 76 - set_layout<GUI::VerticalBoxLayout>(); 77 - layout()->set_margins(4); 76 + set_layout<GUI::VerticalBoxLayout>(4); 78 77 m_stack_table = add<GUI::TableView>(); 79 78 m_stack_table->set_model(adopt_ref(*new ThreadStackModel())); 80 79 }
+1 -2
Userland/Applications/SystemMonitor/main.cpp
··· 561 561 Vector<SystemMonitor::GraphWidget&> cpu_graphs; 562 562 for (auto row = 0u; row < cpu_graph_rows; ++row) { 563 563 auto& cpu_graph_row = cpu_graph_group_box.add<GUI::Widget>(); 564 - cpu_graph_row.set_layout<GUI::HorizontalBoxLayout>(); 565 - cpu_graph_row.layout()->set_margins(6); 564 + cpu_graph_row.set_layout<GUI::HorizontalBoxLayout>(6); 566 565 cpu_graph_row.set_fixed_height(108); 567 566 for (auto i = 0u; i < cpu_graphs_per_row; ++i) { 568 567 auto& cpu_graph = cpu_graph_row.add<SystemMonitor::GraphWidget>();
+2 -4
Userland/Applications/Terminal/main.cpp
··· 175 175 auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); 176 176 main_widget->set_fill_with_background_color(true); 177 177 main_widget->set_background_role(ColorRole::Button); 178 - (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>()); 179 - main_widget->layout()->set_margins(4); 178 + (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4)); 180 179 181 180 auto find = TRY(main_widget->try_add<GUI::Widget>()); 182 - (void)TRY(find->try_set_layout<GUI::HorizontalBoxLayout>()); 183 - find->layout()->set_margins(4); 181 + (void)TRY(find->try_set_layout<GUI::HorizontalBoxLayout>(4)); 184 182 find->set_fixed_height(30); 185 183 186 184 auto find_textbox = TRY(find->try_add<GUI::TextBox>());
+2 -6
Userland/Applications/ThemeEditor/MainWidget.cpp
··· 435 435 436 436 auto properties_list = TRY(GUI::Widget::try_create()); 437 437 scrollable_container->set_widget(properties_list); 438 - (void)TRY(properties_list->try_set_layout<GUI::VerticalBoxLayout>()); 439 - properties_list->layout()->set_spacing(12); 440 - properties_list->layout()->set_margins({ 8 }); 438 + (void)TRY(properties_list->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8 }, 12)); 441 439 442 440 for (auto const& group : property_tab.property_groups) { 443 441 NonnullRefPtr<GUI::GroupBox> group_box = TRY(properties_list->try_add<GUI::GroupBox>(group.title)); 444 - (void)TRY(group_box->try_set_layout<GUI::VerticalBoxLayout>()); 445 - group_box->layout()->set_spacing(12); 446 442 // 1px less on the left makes the text line up with the group title. 447 - group_box->layout()->set_margins({ 8, 8, 8, 7 }); 443 + (void)TRY(group_box->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8, 8, 8, 7 }, 12)); 448 444 group_box->set_preferred_height(GUI::SpecialDimension::Fit); 449 445 450 446 for (auto const& property : group.properties) {
+2 -4
Userland/Demos/CatDog/main.cpp
··· 42 42 43 43 auto catdog_widget = TRY(CatDog::create()); 44 44 window->set_main_widget(catdog_widget); 45 - (void)TRY(catdog_widget->try_set_layout<GUI::VerticalBoxLayout>()); 46 - catdog_widget->layout()->set_spacing(0); 45 + (void)TRY(catdog_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0)); 47 46 48 47 auto context_menu = TRY(GUI::Menu::try_create()); 49 48 TRY(context_menu->try_add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window))); ··· 63 62 advice_window->set_alpha_hit_threshold(1.0f); 64 63 65 64 auto advice_widget = TRY(advice_window->set_main_widget<SpeechBubble>(catdog_widget)); 66 - (void)TRY(advice_widget->try_set_layout<GUI::VerticalBoxLayout>()); 67 - advice_widget->layout()->set_spacing(0); 65 + (void)TRY(advice_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0)); 68 66 69 67 auto advice_timer = TRY(Core::Timer::create_single_shot(15'000, [&] { 70 68 window->move_to_front();
+1 -2
Userland/Demos/ModelGallery/GalleryWidget.cpp
··· 13 13 set_layout<GUI::VerticalBoxLayout>(); 14 14 15 15 auto& inner_widget = add<GUI::Widget>(); 16 - auto inner_layout = inner_widget.try_set_layout<GUI::VerticalBoxLayout>().release_value_but_fixme_should_propagate_errors(); 17 - inner_layout->set_margins({ 4 }); 16 + (void)inner_widget.try_set_layout<GUI::VerticalBoxLayout>(4).release_value_but_fixme_should_propagate_errors(); 18 17 19 18 m_tab_widget = inner_widget.try_add<GUI::TabWidget>().release_value_but_fixme_should_propagate_errors(); 20 19 m_statusbar = add<GUI::Statusbar>();
+3 -6
Userland/DevTools/HackStudio/HackStudioWidget.cpp
··· 85 85 86 86 widget->m_editor_font = widget->read_editor_font_from_config(); 87 87 widget->set_fill_with_background_color(true); 88 - widget->set_layout<GUI::VerticalBoxLayout>(); 89 - widget->layout()->set_spacing(2); 88 + widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 2); 90 89 91 90 auto& toolbar_container = widget->add<GUI::ToolbarContainer>(); 92 91 ··· 1363 1362 m_project_tab->set_tab_position(GUI::TabWidget::TabPosition::Bottom); 1364 1363 1365 1364 auto& tree_view_container = m_project_tab->add_tab<GUI::Widget>("Files"); 1366 - tree_view_container.set_layout<GUI::VerticalBoxLayout>(); 1367 - tree_view_container.layout()->set_margins(2); 1365 + tree_view_container.set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 2); 1368 1366 1369 1367 m_project_tree_view = tree_view_container.add<GUI::TreeView>(); 1370 1368 configure_project_tree_view(); 1371 1369 1372 1370 auto& class_view_container = m_project_tab->add_tab<GUI::Widget>("Classes"); 1373 - class_view_container.set_layout<GUI::VerticalBoxLayout>(); 1374 - class_view_container.layout()->set_margins(2); 1371 + class_view_container.set_layout<GUI::VerticalBoxLayout>(2); 1375 1372 1376 1373 m_class_view = class_view_container.add<ClassViewWidget>(); 1377 1374
+6 -12
Userland/DevTools/Profiler/main.cpp
··· 132 132 auto tab_widget = TRY(main_splitter->try_add<GUI::TabWidget>()); 133 133 134 134 auto tree_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Call Tree")); 135 - tree_tab->set_layout<GUI::VerticalBoxLayout>(); 136 - tree_tab->layout()->set_margins(4); 135 + (void)TRY(tree_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 137 136 auto bottom_splitter = TRY(tree_tab->try_add<GUI::VerticalSplitter>()); 138 137 139 138 auto tree_view = TRY(bottom_splitter->try_add<GUI::TreeView>()); ··· 182 181 }); 183 182 184 183 auto samples_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Samples")); 185 - samples_tab->set_layout<GUI::VerticalBoxLayout>(); 186 - samples_tab->layout()->set_margins(4); 184 + (void)TRY(samples_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 187 185 188 186 auto samples_splitter = TRY(samples_tab->try_add<GUI::HorizontalSplitter>()); 189 187 auto samples_table_view = TRY(samples_splitter->try_add<GUI::TableView>()); ··· 197 195 }; 198 196 199 197 auto signposts_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Signposts")); 200 - signposts_tab->set_layout<GUI::VerticalBoxLayout>(); 201 - signposts_tab->layout()->set_margins(4); 198 + (void)TRY(signposts_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 202 199 203 200 auto signposts_splitter = TRY(signposts_tab->try_add<GUI::HorizontalSplitter>()); 204 201 auto signposts_table_view = TRY(signposts_splitter->try_add<GUI::TableView>()); ··· 212 209 }; 213 210 214 211 auto flamegraph_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Flame Graph")); 215 - flamegraph_tab->set_layout<GUI::VerticalBoxLayout>(); 216 - flamegraph_tab->layout()->set_margins({ 4, 4, 4, 4 }); 212 + (void)TRY(flamegraph_tab->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 4, 4, 4 })); 217 213 218 214 auto flamegraph_view = TRY(flamegraph_tab->try_add<FlameGraphView>(profile->model(), ProfileModel::Column::StackFrame, ProfileModel::Column::SampleCount)); 219 215 ··· 261 257 flamegraph_view->on_hover_change = [&] { statusbar_update(); }; 262 258 263 259 auto filesystem_events_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Filesystem events")); 264 - filesystem_events_tab->set_layout<GUI::VerticalBoxLayout>(); 265 - filesystem_events_tab->layout()->set_margins(4); 260 + (void)TRY(filesystem_events_tab->try_set_layout<GUI::VerticalBoxLayout>(4)); 266 261 267 262 auto filesystem_events_tree_view = TRY(filesystem_events_tab->try_add<GUI::TreeView>()); 268 263 filesystem_events_tree_view->set_should_fill_selected_rows(true); ··· 320 315 321 316 auto widget = window->set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 322 317 widget->set_fill_with_background_color(true); 323 - auto& layout = widget->set_layout<GUI::VerticalBoxLayout>(); 324 - layout.set_margins({ 0, 0, 16 }); 318 + widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 0, 0, 16 }); 325 319 326 320 auto& timer_label = widget->add<GUI::Label>("..."); 327 321 Core::ElapsedTimer clock;
+1 -2
Userland/DevTools/SQLStudio/MainWidget.cpp
··· 227 227 m_action_tab_widget = find_descendant_of_type_named<GUI::TabWidget>("action_tab_widget"sv); 228 228 229 229 m_query_results_widget = m_action_tab_widget->add_tab<GUI::Widget>("Results"); 230 - m_query_results_widget->set_layout<GUI::VerticalBoxLayout>(); 231 - m_query_results_widget->layout()->set_margins(6); 230 + m_query_results_widget->set_layout<GUI::VerticalBoxLayout>(6); 232 231 m_query_results_table_view = m_query_results_widget->add<GUI::TableView>(); 233 232 234 233 m_action_tab_widget->on_tab_close_click = [this](auto&) {
+1 -2
Userland/Games/GameOfLife/main.cpp
··· 60 60 main_toolbar.layout()->set_margins({ 0, 6 }); 61 61 62 62 auto& board_widget_container = *main_widget->find_descendant_of_type_named<GUI::Widget>("board_widget_container"); 63 - auto board_layout = TRY(board_widget_container.try_set_layout<GUI::VerticalBoxLayout>()); 64 - board_layout->set_spacing(0); 63 + (void)TRY(board_widget_container.try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0)); 65 64 auto board_widget = TRY(board_widget_container.try_add<BoardWidget>(board_rows, board_columns)); 66 65 board_widget->randomize_cells(); 67 66
+1 -3
Userland/Games/Hearts/Game.cpp
··· 124 124 125 125 auto score_widget = score_dialog->set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 126 126 score_widget->set_fill_with_background_color(true); 127 - auto& layout = score_widget->set_layout<GUI::HorizontalBoxLayout>(); 128 - layout.set_margins(10); 129 - layout.set_spacing(15); 127 + score_widget->set_layout<GUI::HorizontalBoxLayout>(10, 15); 130 128 131 129 auto& card_container = score_widget->add<GUI::Widget>(); 132 130 auto& score_card = card_container.add<ScoreCard>(m_players, game_over);
+3 -6
Userland/Games/Hearts/SettingsDialog.cpp
··· 22 22 auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 23 23 main_widget->set_fill_with_background_color(true); 24 24 25 - auto& layout = main_widget->set_layout<GUI::VerticalBoxLayout>(); 26 - layout.set_margins(4); 25 + main_widget->set_layout<GUI::VerticalBoxLayout>(4); 27 26 28 27 auto& name_box = main_widget->add<GUI::Widget>(); 29 - auto& input_layout = name_box.set_layout<GUI::HorizontalBoxLayout>(); 30 - input_layout.set_spacing(4); 28 + name_box.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 4); 31 29 32 30 auto& name_label = name_box.add<GUI::Label>("Name:"); 33 31 name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 39 37 }; 40 38 41 39 auto& button_box = main_widget->add<GUI::Widget>(); 42 - auto& button_layout = button_box.set_layout<GUI::HorizontalBoxLayout>(); 43 - button_layout.set_spacing(10); 40 + button_box.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 12); 44 41 45 42 button_box.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv)).on_click = [this](auto) { 46 43 done(ExecResult::Cancel);
+1 -2
Userland/Libraries/LibGUI/Breadcrumbbar.cpp
··· 60 60 61 61 Breadcrumbbar::Breadcrumbbar() 62 62 { 63 - auto& layout = set_layout<HorizontalBoxLayout>(); 64 - layout.set_spacing(0); 63 + set_layout<HorizontalBoxLayout>(GUI::Margins {}, 0); 65 64 } 66 65 67 66 void Breadcrumbbar::clear_segments()
+7 -16
Userland/Libraries/LibGUI/ColorPicker.cpp
··· 207 207 void ColorPicker::build_ui() 208 208 { 209 209 auto root_container = set_main_widget<Widget>().release_value_but_fixme_should_propagate_errors(); 210 - root_container->set_layout<VerticalBoxLayout>(); 211 - root_container->layout()->set_margins(4); 210 + root_container->set_layout<VerticalBoxLayout>(4); 212 211 root_container->set_fill_with_background_color(true); 213 212 214 213 auto& tab_widget = root_container->add<GUI::TabWidget>(); 215 214 216 215 auto& tab_palette = tab_widget.add_tab<Widget>("Palette"); 217 - tab_palette.set_layout<VerticalBoxLayout>(); 218 - tab_palette.layout()->set_margins(4); 219 - tab_palette.layout()->set_spacing(4); 216 + tab_palette.set_layout<VerticalBoxLayout>(4, 4); 220 217 221 218 build_ui_palette(tab_palette); 222 219 223 220 auto& tab_custom_color = tab_widget.add_tab<Widget>("Custom Color"); 224 - tab_custom_color.set_layout<VerticalBoxLayout>(); 225 - tab_custom_color.layout()->set_margins(4); 226 - tab_custom_color.layout()->set_spacing(4); 221 + tab_custom_color.set_layout<VerticalBoxLayout>(4, 4); 227 222 228 223 build_ui_custom(tab_custom_color); 229 224 230 225 auto& button_container = root_container->add<Widget>(); 231 226 button_container.set_preferred_height(GUI::SpecialDimension::Fit); 232 - button_container.set_layout<HorizontalBoxLayout>(); 233 - button_container.layout()->set_spacing(4); 234 - button_container.layout()->add_spacer(); 227 + button_container.set_layout<HorizontalBoxLayout>(4); 228 + button_container.add_spacer().release_value_but_fixme_should_propagate_errors(); 235 229 236 230 auto& ok_button = button_container.add<DialogButton>(); 237 231 ok_button.set_text(String::from_utf8_short_string("OK"sv)); ··· 315 309 316 310 // Right Side 317 311 auto& vertical_container = horizontal_container.add<Widget>(); 318 - vertical_container.set_layout<VerticalBoxLayout>(); 319 - vertical_container.layout()->set_margins({ 0, 0, 0, 8 }); 312 + vertical_container.set_layout<VerticalBoxLayout>(GUI::Margins { 0, 0, 0, 8 }); 320 313 vertical_container.set_min_width(120); 321 314 322 315 auto& preview_container = vertical_container.add<Frame>(); 323 - preview_container.set_layout<VerticalBoxLayout>(); 324 - preview_container.layout()->set_margins(2); 325 - preview_container.layout()->set_spacing(0); 316 + preview_container.set_layout<VerticalBoxLayout>(2, 0); 326 317 preview_container.set_fixed_height(100); 327 318 328 319 // Current color
+1 -2
Userland/Libraries/LibGUI/CommandPalette.cpp
··· 186 186 main_widget->set_frame_shape(Gfx::FrameShape::Window); 187 187 main_widget->set_fill_with_background_color(true); 188 188 189 - auto& layout = main_widget->set_layout<GUI::VerticalBoxLayout>(); 190 - layout.set_margins(4); 189 + main_widget->set_layout<GUI::VerticalBoxLayout>(4); 191 190 192 191 m_text_box = main_widget->add<GUI::TextBox>(); 193 192 m_table_view = main_widget->add<GUI::TableView>();
+1 -3
Userland/Libraries/LibGUI/EmojiInputDialog.cpp
··· 219 219 for (size_t row = 0; row < rows && index < m_emojis.size(); ++row) { 220 220 auto& horizontal_container = m_emojis_widget->add<Widget>(); 221 221 horizontal_container.set_preferred_height(SpecialDimension::Fit); 222 - 223 - auto& horizontal_layout = horizontal_container.set_layout<HorizontalBoxLayout>(); 224 - horizontal_layout.set_spacing(0); 222 + horizontal_container.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 0); 225 223 226 224 for (size_t column = 0; column < columns; ++column) { 227 225 bool found_match = false;
+2 -6
Userland/Libraries/LibGUI/InputBox.cpp
··· 67 67 int title_width = widget->font().width(title()) + 24 /* icon, plus a little padding -- not perfect */; 68 68 int max_width = max(text_width, title_width); 69 69 70 - widget->set_layout<VerticalBoxLayout>(); 70 + widget->set_layout<VerticalBoxLayout>(6, 6); 71 71 widget->set_fill_with_background_color(true); 72 72 widget->set_preferred_height(SpecialDimension::Fit); 73 - 74 - widget->layout()->set_margins(6); 75 - widget->layout()->set_spacing(6); 76 73 77 74 auto& label_editor_container = widget->add<Widget>(); 78 75 label_editor_container.set_layout<HorizontalBoxLayout>(); ··· 101 98 button_container_outer.set_layout<VerticalBoxLayout>(); 102 99 103 100 auto& button_container_inner = button_container_outer.add<Widget>(); 104 - button_container_inner.set_layout<HorizontalBoxLayout>(); 101 + button_container_inner.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 6); 105 102 button_container_inner.set_preferred_height(SpecialDimension::Fit); 106 - button_container_inner.layout()->set_spacing(6); 107 103 button_container_inner.add_spacer().release_value_but_fixme_should_propagate_errors(); 108 104 109 105 m_ok_button = button_container_inner.add<DialogButton>();
+3 -8
Userland/Libraries/LibGUI/MessageBox.cpp
··· 121 121 int total_text_height = number_of_lines * padded_text_height; 122 122 int icon_width = 0; 123 123 124 - widget->set_layout<VerticalBoxLayout>(); 124 + widget->set_layout<VerticalBoxLayout>(8, 6); 125 125 widget->set_fill_with_background_color(true); 126 126 127 - widget->layout()->set_margins(8); 128 - widget->layout()->set_spacing(6); 129 - 130 127 auto& message_container = widget->add<Widget>(); 131 - message_container.set_layout<HorizontalBoxLayout>(); 132 - message_container.layout()->set_spacing(8); 128 + message_container.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 8); 133 129 134 130 if (m_type != Type::None) { 135 131 auto& icon_image = message_container.add<ImageWidget>(); ··· 147 143 label.set_text_alignment(Gfx::TextAlignment::CenterLeft); 148 144 149 145 auto& button_container = widget->add<Widget>(); 150 - button_container.set_layout<HorizontalBoxLayout>(); 146 + button_container.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 8); 151 147 button_container.set_fixed_height(24); 152 - button_container.layout()->set_spacing(8); 153 148 154 149 constexpr int button_width = 80; 155 150 int button_count = 0;
+1 -2
Userland/Libraries/LibGUI/ProcessChooser.cpp
··· 48 48 49 49 auto& button_container = widget->add<GUI::Widget>(); 50 50 button_container.set_fixed_height(30); 51 - button_container.set_layout<GUI::HorizontalBoxLayout>(); 52 - button_container.layout()->set_margins({ 0, 4, 0 }); 51 + button_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 0, 4, 0 }); 53 52 button_container.add_spacer().release_value_but_fixme_should_propagate_errors(); 54 53 55 54 auto& select_button = button_container.add<GUI::Button>(m_button_label);
+2 -5
Userland/Libraries/LibGUI/SettingsWindow.cpp
··· 34 34 35 35 auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); 36 36 main_widget->set_fill_with_background_color(true); 37 - (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>()); 38 - main_widget->layout()->set_margins(4); 39 - main_widget->layout()->set_spacing(6); 37 + (void)TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6)); 40 38 41 39 window->m_tab_widget = TRY(main_widget->try_add<GUI::TabWidget>()); 42 40 43 41 auto button_container = TRY(main_widget->try_add<GUI::Widget>()); 44 42 button_container->set_preferred_size({ SpecialDimension::Grow, SpecialDimension::Fit }); 45 - (void)TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>()); 46 - button_container->layout()->set_spacing(6); 43 + (void)TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6)); 47 44 48 45 if (show_defaults_button == ShowDefaultsButton::Yes) { 49 46 window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>(TRY(String::from_utf8("Defaults"sv))));
+1 -3
Userland/Libraries/LibGUI/Statusbar.cpp
··· 20 20 Statusbar::Statusbar(int count) 21 21 { 22 22 set_fixed_height(18); 23 - set_layout<HorizontalBoxLayout>(); 24 - layout()->set_margins(0); 25 - layout()->set_spacing(2); 23 + set_layout<HorizontalBoxLayout>(0, 2); 26 24 27 25 m_corner = add<ResizeCorner>(); 28 26 set_segment_count(count);
+1 -3
Userland/Libraries/LibGUI/Toolbar.cpp
··· 34 34 else 35 35 set_fixed_width(button_size); 36 36 37 - set_layout<BoxLayout>(orientation); 38 - layout()->set_spacing(0); 39 - layout()->set_margins({ 2, 2, 2, 2 }); 37 + set_layout<BoxLayout>(orientation, GUI::Margins { 2, 2, 2, 2 }, 0); 40 38 } 41 39 42 40 class ToolbarButton final : public Button {
+1 -2
Userland/Libraries/LibGUI/ToolbarContainer.cpp
··· 23 23 set_frame_shape(Gfx::FrameShape::Box); 24 24 set_frame_shadow(Gfx::FrameShadow::Sunken); 25 25 26 - auto& layout = set_layout<VerticalBoxLayout>(); 27 - layout.set_spacing(2); 26 + set_layout<VerticalBoxLayout>(GUI::Margins {}, 2); 28 27 set_shrink_to_fit(true); 29 28 } 30 29
+1 -2
Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp
··· 24 24 m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"sv); 25 25 26 26 m_content_widget = add<Widget>(); 27 - m_content_widget->set_layout<VerticalBoxLayout>(); 28 - m_content_widget->layout()->set_margins(20); 27 + m_content_widget->set_layout<VerticalBoxLayout>(20); 29 28 30 29 m_header_label = m_content_widget->add<Label>(); 31 30 m_header_label->set_font(Gfx::FontDatabase::the().get("Pebbleton", 14, 700, Gfx::FontWidth::Normal, 0));
+2 -5
Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp
··· 29 29 30 30 auto main_widget = set_main_widget<Widget>().release_value_but_fixme_should_propagate_errors(); 31 31 main_widget->set_fill_with_background_color(true); 32 - main_widget->set_layout<VerticalBoxLayout>(); 33 - main_widget->layout()->set_spacing(0); 32 + main_widget->set_layout<VerticalBoxLayout>(GUI::Margins {}, 0); 34 33 35 34 m_page_container_widget = main_widget->add<Widget>(); 36 35 m_page_container_widget->set_fixed_size(500, 315); ··· 40 39 separator.set_fixed_height(2); 41 40 42 41 auto& nav_container_widget = main_widget->add<Widget>(); 43 - nav_container_widget.set_layout<HorizontalBoxLayout>(); 42 + nav_container_widget.set_layout<HorizontalBoxLayout>(GUI::Margins { 0, 10 }, 0); 44 43 nav_container_widget.set_fixed_height(42); 45 - nav_container_widget.layout()->set_margins({ 0, 10 }); 46 - nav_container_widget.layout()->set_spacing(0); 47 44 nav_container_widget.add_spacer().release_value_but_fixme_should_propagate_errors(); 48 45 49 46 m_back_button = nav_container_widget.add<DialogButton>(String::from_utf8_short_string("< Back"sv));
+3 -6
Userland/Libraries/LibGUI/Wizards/WizardPage.cpp
··· 17 17 WizardPage::WizardPage(DeprecatedString const& title_text, DeprecatedString const& subtitle_text) 18 18 : AbstractWizardPage() 19 19 { 20 - set_layout<VerticalBoxLayout>(); 21 - layout()->set_spacing(0); 20 + set_layout<VerticalBoxLayout>(GUI::Margins {}, 0); 22 21 23 22 auto& header_widget = add<Widget>(); 24 23 header_widget.set_fill_with_background_color(true); 25 24 header_widget.set_background_role(Gfx::ColorRole::Base); 26 25 header_widget.set_fixed_height(58); 27 26 28 - header_widget.set_layout<VerticalBoxLayout>(); 29 - header_widget.layout()->set_margins({ 15, 30, 0 }); 27 + header_widget.set_layout<VerticalBoxLayout>(GUI::Margins { 15, 30, 0 }); 30 28 m_title_label = header_widget.add<Label>(title_text); 31 29 m_title_label->set_font(Gfx::FontDatabase::default_font().bold_variant()); 32 30 m_title_label->set_fixed_height(m_title_label->font().glyph_height() + 2); ··· 40 38 separator.set_fixed_height(2); 41 39 42 40 m_body_widget = add<Widget>(); 43 - m_body_widget->set_layout<VerticalBoxLayout>(); 44 - m_body_widget->layout()->set_margins(20); 41 + m_body_widget->set_layout<VerticalBoxLayout>(20); 45 42 } 46 43 47 44 void WizardPage::set_page_title(DeprecatedString const& text)
+1 -3
Userland/Services/NotificationServer/NotificationWindow.cpp
··· 70 70 auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 71 71 72 72 widget->set_fill_with_background_color(true); 73 - widget->set_layout<GUI::HorizontalBoxLayout>(); 74 - widget->layout()->set_margins(8); 75 - widget->layout()->set_spacing(6); 73 + widget->set_layout<GUI::HorizontalBoxLayout>(8, 6); 76 74 77 75 m_image = &widget->add<GUI::ImageWidget>(); 78 76 m_image->set_visible(icon.is_valid());
+4 -9
Userland/Services/Taskbar/ClockWidget.cpp
··· 43 43 44 44 auto root_container = m_calendar_window->set_main_widget<GUI::Frame>().release_value_but_fixme_should_propagate_errors(); 45 45 root_container->set_fill_with_background_color(true); 46 - root_container->set_layout<GUI::VerticalBoxLayout>(); 47 - root_container->layout()->set_margins({ 2, 0 }); 48 - root_container->layout()->set_spacing(0); 46 + root_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 2, 0 }, 0); 49 47 root_container->set_frame_shape(Gfx::FrameShape::Window); 50 48 51 49 auto& navigation_container = root_container->add<GUI::Widget>(); 52 50 navigation_container.set_fixed_height(24); 53 - navigation_container.set_layout<GUI::HorizontalBoxLayout>(); 54 - navigation_container.layout()->set_margins({ 2 }); 51 + navigation_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2 }); 55 52 56 53 m_prev_date = navigation_container.add<GUI::Button>(); 57 54 m_prev_date->set_button_style(Gfx::ButtonStyle::Coolbar); ··· 114 111 separator1.set_fixed_height(2); 115 112 116 113 auto& calendar_container = root_container->add<GUI::Widget>(); 117 - calendar_container.set_layout<GUI::HorizontalBoxLayout>(); 118 - calendar_container.layout()->set_margins({ 2 }); 114 + calendar_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2 }); 119 115 120 116 m_calendar = calendar_container.add<GUI::Calendar>(); 121 117 m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors()); ··· 133 129 134 130 auto& settings_container = root_container->add<GUI::Widget>(); 135 131 settings_container.set_fixed_height(24); 136 - settings_container.set_layout<GUI::HorizontalBoxLayout>(); 137 - settings_container.layout()->set_margins({ 2 }); 132 + settings_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2 }); 138 133 settings_container.add_spacer().release_value_but_fixme_should_propagate_errors(); 139 134 140 135 m_jump_to_button = settings_container.add<GUI::Button>();
+1 -2
Userland/Services/Taskbar/QuickLaunchWidget.cpp
··· 105 105 QuickLaunchWidget::QuickLaunchWidget() 106 106 { 107 107 set_shrink_to_fit(true); 108 - set_layout<GUI::HorizontalBoxLayout>(); 109 - layout()->set_spacing(0); 108 + set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 0); 110 109 set_frame_thickness(0); 111 110 set_fixed_height(24); 112 111 }
+5 -9
Userland/Services/Taskbar/ShutdownDialog.cpp
··· 44 44 { 45 45 auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors(); 46 46 widget->set_fill_with_background_color(true); 47 - widget->set_layout<GUI::VerticalBoxLayout>(); 48 - widget->layout()->set_spacing(0); 47 + widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0); 49 48 50 49 auto& banner_image = widget->add<GUI::ImageWidget>(); 51 50 banner_image.load_from_file("/res/graphics/brand-banner.png"sv); ··· 55 54 56 55 auto& left_container = content_container.add<GUI::Widget>(); 57 56 left_container.set_fixed_width(60); 58 - left_container.set_layout<GUI::VerticalBoxLayout>(); 59 - left_container.layout()->set_margins({ 12, 0, 0 }); 57 + left_container.set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 12, 0, 0 }); 60 58 61 59 auto& icon_wrapper = left_container.add<GUI::Widget>(); 62 60 icon_wrapper.set_fixed_size(32, 48); ··· 66 64 icon_image.set_bitmap(Gfx::Bitmap::load_from_file("/res/icons/32x32/shutdown.png"sv).release_value_but_fixme_should_propagate_errors()); 67 65 68 66 auto& right_container = content_container.add<GUI::Widget>(); 69 - right_container.set_layout<GUI::VerticalBoxLayout>(); 70 - right_container.layout()->set_margins({ 12, 12, 8, 0 }); 67 + right_container.set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 12, 12, 8, 0 }); 71 68 72 69 auto& label = right_container.add<GUI::Label>("What would you like to do?"); 73 70 label.set_text_alignment(Gfx::TextAlignment::CenterLeft); ··· 90 87 } 91 88 } 92 89 93 - right_container.layout()->add_spacer(); 90 + right_container.add_spacer().release_value_but_fixme_should_propagate_errors(); 94 91 95 92 auto& button_container = right_container.add<GUI::Widget>(); 96 93 button_container.set_fixed_height(23); 97 - button_container.set_layout<GUI::HorizontalBoxLayout>(); 98 - button_container.layout()->set_spacing(5); 94 + button_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5); 99 95 button_container.add_spacer().release_value_but_fixme_should_propagate_errors(); 100 96 auto& ok_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv)); 101 97 ok_button.set_fixed_size(80, 23);
+2 -4
Userland/Services/Taskbar/TaskbarWindow.cpp
··· 73 73 ErrorOr<void> TaskbarWindow::populate_taskbar() 74 74 { 75 75 auto main_widget = TRY(set_main_widget<TaskbarWidget>()); 76 - (void)TRY(main_widget->try_set_layout<GUI::HorizontalBoxLayout>()); 77 - main_widget->layout()->set_margins({ 2, 3, 0, 3 }); 76 + (void)TRY(main_widget->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2, 3, 0, 3 })); 78 77 79 78 m_quick_launch = TRY(Taskbar::QuickLaunchWidget::create()); 80 79 TRY(main_widget->try_add_child(*m_quick_launch)); 81 80 82 81 m_task_button_container = TRY(main_widget->try_add<GUI::Widget>()); 83 - (void)TRY(m_task_button_container->try_set_layout<GUI::HorizontalBoxLayout>()); 84 - m_task_button_container->layout()->set_spacing(3); 82 + (void)TRY(m_task_button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 3)); 85 83 86 84 m_default_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png"sv)); 87 85