summaryrefslogtreecommitdiff
path: root/Applications/SystemMonitor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-02 09:48:11 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-02 15:09:48 +0100
commitd67da8c1015c923d799409fee9bf6dd2eafc82b8 (patch)
tree554e5304a94b3b5aab8d60cca5846a1643d00175 /Applications/SystemMonitor
parent63364f8a5d70fbbf851c10cff4da62b1ae51177d (diff)
downloadserenity-d67da8c1015c923d799409fee9bf6dd2eafc82b8.zip
LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes
Diffstat (limited to 'Applications/SystemMonitor')
-rw-r--r--Applications/SystemMonitor/MemoryStatsWidget.cpp4
-rw-r--r--Applications/SystemMonitor/NetworkStatisticsWidget.cpp6
-rw-r--r--Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp2
-rw-r--r--Applications/SystemMonitor/ProcessMemoryMapWidget.cpp2
-rw-r--r--Applications/SystemMonitor/ProcessStacksWidget.cpp2
-rw-r--r--Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp2
-rw-r--r--Applications/SystemMonitor/main.cpp16
7 files changed, 17 insertions, 17 deletions
diff --git a/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Applications/SystemMonitor/MemoryStatsWidget.cpp
index 350a7aea8d..696c88ed59 100644
--- a/Applications/SystemMonitor/MemoryStatsWidget.cpp
+++ b/Applications/SystemMonitor/MemoryStatsWidget.cpp
@@ -52,13 +52,13 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GWidget* parent)
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
set_preferred_size(0, 72);
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 0, 8, 0, 0 });
layout()->set_spacing(3);
auto build_widgets_for_label = [this](const String& description) -> RefPtr<GLabel> {
auto container = GWidget::construct(this);
- container->set_layout(make<GBoxLayout>(Orientation::Horizontal));
+ container->set_layout(make<GHBoxLayout>());
container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
container->set_preferred_size(275, 12);
auto description_label = GLabel::construct(description, container);
diff --git a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp
index aeece6395a..8e269b3c44 100644
--- a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp
+++ b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp
@@ -34,12 +34,12 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent)
: GLazyWidget(parent)
{
on_first_show = [this](auto&) {
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 4, 4, 4, 4 });
set_fill_with_background_color(true);
auto adapters_group_box = GGroupBox::construct("Adapters", this);
- adapters_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical));
+ adapters_group_box->set_layout(make<GVBoxLayout>());
adapters_group_box->layout()->set_margins({ 6, 16, 6, 6 });
adapters_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
adapters_group_box->set_preferred_size(0, 120);
@@ -59,7 +59,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent)
m_adapter_table_view->set_model(GJsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields)));
auto sockets_group_box = GGroupBox::construct("Sockets", this);
- sockets_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical));
+ sockets_group_box->set_layout(make<GVBoxLayout>());
sockets_group_box->layout()->set_margins({ 6, 16, 6, 6 });
sockets_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
sockets_group_box->set_preferred_size(0, 0);
diff --git a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp
index a4ec79fd08..9f4e68913d 100644
--- a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp
+++ b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp
@@ -32,7 +32,7 @@
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GWidget* parent)
: GWidget(parent)
{
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = GTableView::construct(this);
m_table_view->set_size_columns_to_fit_content(true);
diff --git a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
index a8b3f02aa9..fe431b66b3 100644
--- a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
+++ b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp
@@ -34,7 +34,7 @@
ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent)
: GWidget(parent)
{
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = GTableView::construct(this);
m_table_view->set_size_columns_to_fit_content(true);
diff --git a/Applications/SystemMonitor/ProcessStacksWidget.cpp b/Applications/SystemMonitor/ProcessStacksWidget.cpp
index 795fa9efa3..637a252205 100644
--- a/Applications/SystemMonitor/ProcessStacksWidget.cpp
+++ b/Applications/SystemMonitor/ProcessStacksWidget.cpp
@@ -32,7 +32,7 @@
ProcessStacksWidget::ProcessStacksWidget(GWidget* parent)
: GWidget(parent)
{
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 4, 4, 4, 4 });
m_stacks_editor = GTextEditor::construct(GTextEditor::Type::MultiLine, this);
m_stacks_editor->set_readonly(true);
diff --git a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp
index 174e753469..bf6acabfc2 100644
--- a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp
+++ b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp
@@ -32,7 +32,7 @@
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget(GWidget* parent)
: GWidget(parent)
{
- set_layout(make<GBoxLayout>(Orientation::Vertical));
+ set_layout(make<GVBoxLayout>());
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = GTableView::construct(this);
m_table_view->set_size_columns_to_fit_content(true);
diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp
index 726788a2fd..c300083a14 100644
--- a/Applications/SystemMonitor/main.cpp
+++ b/Applications/SystemMonitor/main.cpp
@@ -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);