diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-02-16 21:07:06 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-02-18 16:56:56 +0000 |
commit | 77ad0fdb0726aba2ecaf7ea9764a642671d1fd6f (patch) | |
tree | 956e10f4c4713e20c03f4aed06f08133f5fcc2e7 /Userland/Applications/Browser | |
parent | 9561ec15f47fdba66a4e8872fd03aae8d0f2df22 (diff) | |
download | serenity-77ad0fdb0726aba2ecaf7ea9764a642671d1fd6f.zip |
Userland: Specify margins and spacing in the GUI::Layout constructor
Diffstat (limited to 'Userland/Applications/Browser')
-rw-r--r-- | Userland/Applications/Browser/BookmarksBarWidget.cpp | 4 | ||||
-rw-r--r-- | Userland/Applications/Browser/DownloadWidget.cpp | 3 | ||||
-rw-r--r-- | Userland/Applications/Browser/InspectorWidget.cpp | 21 |
3 files changed, 9 insertions, 19 deletions
diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index 9166057b48..6e9514b95b 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -103,9 +103,7 @@ BookmarksBarWidget& BookmarksBarWidget::the() BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, bool enabled) { s_the = this; - set_layout<GUI::HorizontalBoxLayout>(); - layout()->set_spacing(0); - layout()->set_margins(2); + set_layout<GUI::HorizontalBoxLayout>(2, 0); set_fixed_height(20); diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp index c440eb1311..5155b9e596 100644 --- a/Userland/Applications/Browser/DownloadWidget.cpp +++ b/Userland/Applications/Browser/DownloadWidget.cpp @@ -59,8 +59,7 @@ DownloadWidget::DownloadWidget(const URL& url) m_download->stream_into(*m_output_file_stream); set_fill_with_background_color(true); - auto& layout = set_layout<GUI::VerticalBoxLayout>(); - layout.set_margins(4); + set_layout<GUI::VerticalBoxLayout>(4); auto& animation_container = add<GUI::Widget>(); animation_container.set_fixed_height(32); diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp index 8e8ad57ee1..08ca2a415c 100644 --- a/Userland/Applications/Browser/InspectorWidget.cpp +++ b/Userland/Applications/Browser/InspectorWidget.cpp @@ -77,15 +77,13 @@ InspectorWidget::InspectorWidget() { set_fill_with_background_color(true); - auto& layout = set_layout<GUI::VerticalBoxLayout>(); - layout.set_margins({ 4, 4, 4, 4 }); + set_layout<GUI::VerticalBoxLayout>(4); auto& splitter = add<GUI::VerticalSplitter>(); auto& top_tab_widget = splitter.add<GUI::TabWidget>(); auto& dom_tree_container = top_tab_widget.add_tab<GUI::Widget>("DOM"); - dom_tree_container.set_layout<GUI::VerticalBoxLayout>(); - dom_tree_container.layout()->set_margins({ 4, 4, 4, 4 }); + dom_tree_container.set_layout<GUI::VerticalBoxLayout>(4); m_dom_tree_view = dom_tree_container.add<GUI::TreeView>(); m_dom_tree_view->on_selection_change = [this] { const auto& index = m_dom_tree_view->selection().first(); @@ -93,30 +91,25 @@ InspectorWidget::InspectorWidget() }; auto& accessibility_tree_container = top_tab_widget.add_tab<GUI::Widget>("Accessibility"); - accessibility_tree_container.set_layout<GUI::VerticalBoxLayout>(); - accessibility_tree_container.layout()->set_margins({ 4, 4, 4, 4 }); + accessibility_tree_container.set_layout<GUI::VerticalBoxLayout>(4); m_accessibility_tree_view = accessibility_tree_container.add<GUI::TreeView>(); auto& bottom_tab_widget = splitter.add<GUI::TabWidget>(); auto& computed_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Computed"); - computed_style_table_container.set_layout<GUI::VerticalBoxLayout>(); - computed_style_table_container.layout()->set_margins({ 4, 4, 4, 4 }); + computed_style_table_container.set_layout<GUI::VerticalBoxLayout>(4); m_computed_style_table_view = computed_style_table_container.add<GUI::TableView>(); auto& resolved_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Resolved"); - resolved_style_table_container.set_layout<GUI::VerticalBoxLayout>(); - resolved_style_table_container.layout()->set_margins({ 4, 4, 4, 4 }); + resolved_style_table_container.set_layout<GUI::VerticalBoxLayout>(4); m_resolved_style_table_view = resolved_style_table_container.add<GUI::TableView>(); auto& custom_properties_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Variables"); - custom_properties_table_container.set_layout<GUI::VerticalBoxLayout>(); - custom_properties_table_container.layout()->set_margins({ 4, 4, 4, 4 }); + custom_properties_table_container.set_layout<GUI::VerticalBoxLayout>(4); m_custom_properties_table_view = custom_properties_table_container.add<GUI::TableView>(); auto& box_model_widget = bottom_tab_widget.add_tab<GUI::Widget>("Box Model"); - box_model_widget.set_layout<GUI::VerticalBoxLayout>(); - box_model_widget.layout()->set_margins({ 4, 4, 4, 4 }); + box_model_widget.set_layout<GUI::VerticalBoxLayout>(4); m_element_size_view = box_model_widget.add<ElementSizePreviewWidget>(); m_element_size_view->set_should_hide_unnecessary_scrollbars(true); |