1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

SystemMonitor: Register a graph_widget pseudo-property in MemoryStatsW

The property graph_widget on MemoryStatsWidget is a-pseudo property that
specifies the name of the graph widget which should be attached to the
MemoryStatsWidget. When the property is set, the widget looks up the
graph with that name in its parent, therefore automatically linking to
the correct widget given that it's a sibling or descendant of a sibling.
This commit is contained in:
kleines Filmröllchen 2022-03-23 01:28:28 +01:00 committed by Andreas Kling
parent abfddd01d4
commit a7d9d416d5
2 changed files with 36 additions and 0 deletions

View file

@ -22,6 +22,9 @@ public:
void set_graph_widget(GraphWidget& graph);
void set_graph_widget_via_name(String name);
String graph_widget_name();
void refresh();
private:
@ -29,6 +32,8 @@ private:
MemoryStatsWidget();
GraphWidget* m_graph;
// Is null if we have a valid graph
String m_graph_widget_name {};
RefPtr<GUI::Label> m_user_physical_pages_label;
RefPtr<GUI::Label> m_user_physical_pages_committed_label;
RefPtr<GUI::Label> m_supervisor_physical_pages_label;