mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
Userland: Specify margins and spacing in the GUI::Layout constructor
This commit is contained in:
parent
9561ec15f4
commit
77ad0fdb07
64 changed files with 136 additions and 288 deletions
|
@ -85,8 +85,7 @@ ErrorOr<NonnullRefPtr<HackStudioWidget>> HackStudioWidget::create(DeprecatedStri
|
|||
|
||||
widget->m_editor_font = widget->read_editor_font_from_config();
|
||||
widget->set_fill_with_background_color(true);
|
||||
widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
widget->layout()->set_spacing(2);
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 2);
|
||||
|
||||
auto& toolbar_container = widget->add<GUI::ToolbarContainer>();
|
||||
|
||||
|
@ -1363,15 +1362,13 @@ void HackStudioWidget::create_project_tab(GUI::Widget& parent)
|
|||
m_project_tab->set_tab_position(GUI::TabWidget::TabPosition::Bottom);
|
||||
|
||||
auto& tree_view_container = m_project_tab->add_tab<GUI::Widget>("Files");
|
||||
tree_view_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
tree_view_container.layout()->set_margins(2);
|
||||
tree_view_container.set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 2);
|
||||
|
||||
m_project_tree_view = tree_view_container.add<GUI::TreeView>();
|
||||
configure_project_tree_view();
|
||||
|
||||
auto& class_view_container = m_project_tab->add_tab<GUI::Widget>("Classes");
|
||||
class_view_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
class_view_container.layout()->set_margins(2);
|
||||
class_view_container.set_layout<GUI::VerticalBoxLayout>(2);
|
||||
|
||||
m_class_view = class_view_container.add<ClassViewWidget>();
|
||||
|
||||
|
|
|
@ -132,8 +132,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto tab_widget = TRY(main_splitter->try_add<GUI::TabWidget>());
|
||||
|
||||
auto tree_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Call Tree"));
|
||||
tree_tab->set_layout<GUI::VerticalBoxLayout>();
|
||||
tree_tab->layout()->set_margins(4);
|
||||
(void)TRY(tree_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
auto bottom_splitter = TRY(tree_tab->try_add<GUI::VerticalSplitter>());
|
||||
|
||||
auto tree_view = TRY(bottom_splitter->try_add<GUI::TreeView>());
|
||||
|
@ -182,8 +181,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
});
|
||||
|
||||
auto samples_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Samples"));
|
||||
samples_tab->set_layout<GUI::VerticalBoxLayout>();
|
||||
samples_tab->layout()->set_margins(4);
|
||||
(void)TRY(samples_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
|
||||
auto samples_splitter = TRY(samples_tab->try_add<GUI::HorizontalSplitter>());
|
||||
auto samples_table_view = TRY(samples_splitter->try_add<GUI::TableView>());
|
||||
|
@ -197,8 +195,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto signposts_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Signposts"));
|
||||
signposts_tab->set_layout<GUI::VerticalBoxLayout>();
|
||||
signposts_tab->layout()->set_margins(4);
|
||||
(void)TRY(signposts_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
|
||||
auto signposts_splitter = TRY(signposts_tab->try_add<GUI::HorizontalSplitter>());
|
||||
auto signposts_table_view = TRY(signposts_splitter->try_add<GUI::TableView>());
|
||||
|
@ -212,8 +209,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto flamegraph_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Flame Graph"));
|
||||
flamegraph_tab->set_layout<GUI::VerticalBoxLayout>();
|
||||
flamegraph_tab->layout()->set_margins({ 4, 4, 4, 4 });
|
||||
(void)TRY(flamegraph_tab->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 4, 4, 4 }));
|
||||
|
||||
auto flamegraph_view = TRY(flamegraph_tab->try_add<FlameGraphView>(profile->model(), ProfileModel::Column::StackFrame, ProfileModel::Column::SampleCount));
|
||||
|
||||
|
@ -261,8 +257,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
flamegraph_view->on_hover_change = [&] { statusbar_update(); };
|
||||
|
||||
auto filesystem_events_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Filesystem events"));
|
||||
filesystem_events_tab->set_layout<GUI::VerticalBoxLayout>();
|
||||
filesystem_events_tab->layout()->set_margins(4);
|
||||
(void)TRY(filesystem_events_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
|
||||
auto filesystem_events_tree_view = TRY(filesystem_events_tab->try_add<GUI::TreeView>());
|
||||
filesystem_events_tree_view->set_should_fill_selected_rows(true);
|
||||
|
@ -320,8 +315,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_
|
|||
|
||||
auto widget = window->set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
|
||||
widget->set_fill_with_background_color(true);
|
||||
auto& layout = widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
layout.set_margins({ 0, 0, 16 });
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 0, 0, 16 });
|
||||
|
||||
auto& timer_label = widget->add<GUI::Label>("...");
|
||||
Core::ElapsedTimer clock;
|
||||
|
|
|
@ -227,8 +227,7 @@ MainWidget::MainWidget()
|
|||
m_action_tab_widget = find_descendant_of_type_named<GUI::TabWidget>("action_tab_widget"sv);
|
||||
|
||||
m_query_results_widget = m_action_tab_widget->add_tab<GUI::Widget>("Results");
|
||||
m_query_results_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
m_query_results_widget->layout()->set_margins(6);
|
||||
m_query_results_widget->set_layout<GUI::VerticalBoxLayout>(6);
|
||||
m_query_results_table_view = m_query_results_widget->add<GUI::TableView>();
|
||||
|
||||
m_action_tab_widget->on_tab_close_click = [this](auto&) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue