diff --git a/Userland/Applications/SystemMonitor/GraphWidget.cpp b/Userland/Applications/SystemMonitor/GraphWidget.cpp index d32c21a83d..45133456cc 100644 --- a/Userland/Applications/SystemMonitor/GraphWidget.cpp +++ b/Userland/Applications/SystemMonitor/GraphWidget.cpp @@ -13,6 +13,10 @@ #include #include +REGISTER_WIDGET(SystemMonitor, GraphWidget) + +namespace SystemMonitor { + void GraphWidget::add_value(Vector&& value) { m_values.enqueue(move(value)); @@ -143,3 +147,5 @@ void GraphWidget::paint_event(GUI::PaintEvent& event) } } } + +} diff --git a/Userland/Applications/SystemMonitor/GraphWidget.h b/Userland/Applications/SystemMonitor/GraphWidget.h index 775b33a299..d988127dd3 100644 --- a/Userland/Applications/SystemMonitor/GraphWidget.h +++ b/Userland/Applications/SystemMonitor/GraphWidget.h @@ -11,6 +11,8 @@ #include #include +namespace SystemMonitor { + class GraphWidget final : public GUI::Frame { C_OBJECT(GraphWidget) public: @@ -46,3 +48,5 @@ private: Vector m_calculated_points; }; + +} diff --git a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp index 80df7ac14a..30d2505d87 100644 --- a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp +++ b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp @@ -24,7 +24,7 @@ MemoryStatsWidget* MemoryStatsWidget::the() return s_the; } -MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph) +MemoryStatsWidget::MemoryStatsWidget(SystemMonitor::GraphWidget& graph) : m_graph(graph) { VERIFY(!s_the); diff --git a/Userland/Applications/SystemMonitor/MemoryStatsWidget.h b/Userland/Applications/SystemMonitor/MemoryStatsWidget.h index ff32ec9753..efe972e9a3 100644 --- a/Userland/Applications/SystemMonitor/MemoryStatsWidget.h +++ b/Userland/Applications/SystemMonitor/MemoryStatsWidget.h @@ -9,7 +9,9 @@ #include +namespace SystemMonitor { class GraphWidget; +} class MemoryStatsWidget final : public GUI::Widget { C_OBJECT(MemoryStatsWidget) @@ -21,9 +23,9 @@ public: void refresh(); private: - MemoryStatsWidget(GraphWidget& graph); + MemoryStatsWidget(SystemMonitor::GraphWidget& graph); - GraphWidget& m_graph; + SystemMonitor::GraphWidget& m_graph; RefPtr m_user_physical_pages_label; RefPtr m_user_physical_pages_committed_label; RefPtr m_supervisor_physical_pages_label; diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index c99a260c0a..4e8976b33d 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -687,14 +687,14 @@ NonnullRefPtr build_performance_tab() auto cpu_graph_rows = ceil_div(ProcessModel::the().cpus().size(), cpu_graphs_per_row); cpu_graph_group_box.set_fixed_height(120u * cpu_graph_rows); - Vector cpu_graphs; + Vector cpu_graphs; for (auto row = 0u; row < cpu_graph_rows; ++row) { auto& cpu_graph_row = cpu_graph_group_box.add(); cpu_graph_row.set_layout(); cpu_graph_row.layout()->set_margins(6); cpu_graph_row.set_fixed_height(108); for (auto i = 0u; i < cpu_graphs_per_row; ++i) { - auto& cpu_graph = cpu_graph_row.add(); + auto& cpu_graph = cpu_graph_row.add(); cpu_graph.set_max(100); cpu_graph.set_value_format(0, { .graph_color_role = ColorRole::SyntaxPreprocessorStatement, @@ -725,7 +725,7 @@ NonnullRefPtr build_performance_tab() memory_graph_group_box.set_layout(); memory_graph_group_box.layout()->set_margins(6); memory_graph_group_box.set_fixed_height(120); - auto& memory_graph = memory_graph_group_box.add(); + auto& memory_graph = memory_graph_group_box.add(); memory_graph.set_stack_values(true); memory_graph.set_value_format(0, { .graph_color_role = ColorRole::SyntaxComment,