1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:55:08 +00:00

LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes

This commit is contained in:
Andreas Kling 2020-02-02 09:48:11 +01:00
parent 63364f8a5d
commit d67da8c101
50 changed files with 128 additions and 114 deletions

View file

@ -116,7 +116,7 @@ int main(int argc, char** argv)
auto keeper = GWidget::construct();
window->set_main_widget(keeper);
keeper->set_layout(make<GBoxLayout>(Orientation::Vertical));
keeper->set_layout(make<GVBoxLayout>());
keeper->set_fill_with_background_color(true);
keeper->layout()->set_margins({ 4, 4, 4, 4 });
@ -138,7 +138,7 @@ int main(int argc, char** argv)
auto network_stats_widget = NetworkStatisticsWidget::construct(nullptr);
tabwidget->add_widget("Network", network_stats_widget);
process_table_container->set_layout(make<GBoxLayout>(Orientation::Vertical));
process_table_container->set_layout(make<GVBoxLayout>());
process_table_container->layout()->set_margins({ 4, 0, 4, 4 });
process_table_container->layout()->set_spacing(0);
@ -279,7 +279,7 @@ RefPtr<GWidget> build_file_systems_tab()
auto fs_widget = GLazyWidget::construct();
fs_widget->on_first_show = [](auto& self) {
self.set_layout(make<GBoxLayout>(Orientation::Vertical));
self.set_layout(make<GVBoxLayout>());
self.layout()->set_margins({ 4, 4, 4, 4 });
auto fs_table_view = GTableView::construct(&self);
fs_table_view->set_size_columns_to_fit_content(true);
@ -368,7 +368,7 @@ RefPtr<GWidget> build_pci_devices_tab()
auto pci_widget = GLazyWidget::construct();
pci_widget->on_first_show = [](auto& self) {
self.set_layout(make<GBoxLayout>(Orientation::Vertical));
self.set_layout(make<GVBoxLayout>());
self.layout()->set_margins({ 4, 4, 4, 4 });
auto pci_table_view = GTableView::construct(&self);
pci_table_view->set_size_columns_to_fit_content(true);
@ -426,7 +426,7 @@ RefPtr<GWidget> build_devices_tab()
auto devices_widget = GLazyWidget::construct();
devices_widget->on_first_show = [](auto& self) {
self.set_layout(make<GBoxLayout>(Orientation::Vertical));
self.set_layout(make<GVBoxLayout>());
self.layout()->set_margins({ 4, 4, 4, 4 });
auto devices_table_view = GTableView::construct(&self);
@ -445,11 +445,11 @@ NonnullRefPtr<GWidget> build_graphs_tab()
graphs_container->on_first_show = [](auto& self) {
self.set_fill_with_background_color(true);
self.set_background_role(ColorRole::Button);
self.set_layout(make<GBoxLayout>(Orientation::Vertical));
self.set_layout(make<GVBoxLayout>());
self.layout()->set_margins({ 4, 4, 4, 4 });
auto cpu_graph_group_box = GGroupBox::construct("CPU usage", &self);
cpu_graph_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical));
cpu_graph_group_box->set_layout(make<GVBoxLayout>());
cpu_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
cpu_graph_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
cpu_graph_group_box->set_preferred_size(0, 120);
@ -466,7 +466,7 @@ NonnullRefPtr<GWidget> build_graphs_tab()
};
auto memory_graph_group_box = GGroupBox::construct("Memory usage", &self);
memory_graph_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical));
memory_graph_group_box->set_layout(make<GVBoxLayout>());
memory_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
memory_graph_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
memory_graph_group_box->set_preferred_size(0, 120);