From 98ed18124dfd789cf843fd15053da4c195b3c1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Wed, 23 Mar 2022 01:31:21 +0100 Subject: [PATCH] SystemMonitor: Register GraphWidget's stack_values property --- Userland/Applications/SystemMonitor/GraphWidget.cpp | 12 ++++++++++++ Userland/Applications/SystemMonitor/GraphWidget.h | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/SystemMonitor/GraphWidget.cpp b/Userland/Applications/SystemMonitor/GraphWidget.cpp index 45133456cc..c592a1900a 100644 --- a/Userland/Applications/SystemMonitor/GraphWidget.cpp +++ b/Userland/Applications/SystemMonitor/GraphWidget.cpp @@ -6,6 +6,7 @@ */ #include "GraphWidget.h" +#include #include #include #include @@ -17,6 +18,17 @@ REGISTER_WIDGET(SystemMonitor, GraphWidget) namespace SystemMonitor { +GraphWidget::GraphWidget() +{ + REGISTER_BOOL_PROPERTY("stack_values", stack_values, set_stack_values); +} + +void GraphWidget::set_stack_values(bool stack_values) +{ + m_stack_values = stack_values; + update(); +} + void GraphWidget::add_value(Vector&& value) { m_values.enqueue(move(value)); diff --git a/Userland/Applications/SystemMonitor/GraphWidget.h b/Userland/Applications/SystemMonitor/GraphWidget.h index d988127dd3..26f078fdd2 100644 --- a/Userland/Applications/SystemMonitor/GraphWidget.h +++ b/Userland/Applications/SystemMonitor/GraphWidget.h @@ -34,10 +34,11 @@ public: m_value_format.resize(index + 1); m_value_format[index] = move(format); } - void set_stack_values(bool stack_values) { m_stack_values = stack_values; } + void set_stack_values(bool stack_values); + bool stack_values() const { return m_stack_values; } private: - explicit GraphWidget() = default; + explicit GraphWidget(); virtual void paint_event(GUI::PaintEvent&) override;