From fffb518edec06c897d2043b4d2e5b4071b8e8f67 Mon Sep 17 00:00:00 2001 From: Raymundo Cassani Date: Sat, 23 May 2020 10:50:04 -0400 Subject: [PATCH] Restructure desklet.js --- .../system-monitor-graph@rcassani/desklet.js | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/files/system-monitor-graph@rcassani/desklet.js b/files/system-monitor-graph@rcassani/desklet.js index 549b91b..f34a603 100644 --- a/files/system-monitor-graph@rcassani/desklet.js +++ b/files/system-monitor-graph@rcassani/desklet.js @@ -26,15 +26,35 @@ MyDesklet.prototype = { }, setupUI: function(){ + // initialize size + + // create the clutter elements + + // type of system variable to graph var type = this.type; // creates container for one child this.window = new St.Bin(); - // creates a label with text - this.text = new St.Label({text: "Hello Desktop ".concat(type)}); + // creates a label to present text + this.text = new St.Label(); // adds label to container this.window.add_actor(this.text); // Sets the container as content actor of the desklet this.setContent(this.window); + + // set decoration settings + + // set initial values + this.update(); }, + + update: function() { + // console log + global.log("update SMG"); + // do the graph + var type = this.type; + // add text to label + this.text.set_text("Hello Desktop2 ".concat(type)); + } + };