mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
SystemMonitor: Register GraphWidget's stack_values property
This commit is contained in:
parent
a7d9d416d5
commit
98ed18124d
Notes:
sideshowbarker
2024-07-17 16:23:06 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/98ed18124d Pull-request: https://github.com/SerenityOS/serenity/pull/13125
2 changed files with 15 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "GraphWidget.h"
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Font.h>
|
||||
|
@ -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<u64, 1>&& value)
|
||||
{
|
||||
m_values.enqueue(move(value));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue