From 119004ba4c789e992ad9465fdf70f9e326a1323b Mon Sep 17 00:00:00 2001 From: rcassani Date: Mon, 18 Apr 2022 15:34:19 -0400 Subject: [PATCH] Solve: bottom alignment of the text elements --- README.md | 1 - files/system-monitor-graph@rcassani/desklet.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 65b67c2..669990c 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ A simple screenshot.

## TODO -- [ ] Bottom alignment of the text elements - [ ] Add other variables such as network, CPU and GPU temperatures, battery levels for PC and peripherals. ### Resources diff --git a/files/system-monitor-graph@rcassani/desklet.js b/files/system-monitor-graph@rcassani/desklet.js index 31e312c..ca27da7 100644 --- a/files/system-monitor-graph@rcassani/desklet.js +++ b/files/system-monitor-graph@rcassani/desklet.js @@ -283,18 +283,18 @@ SystemMonitorGraph.prototype = { }); // text position and content - this.text1.set_position(unit_size, unit_size); + this.text1.set_position(unit_size, (2.5 * unit_size) - this.text1.get_height()); this.text1.set_text(text1); this.text1.style = "font-size: " + text1_size + "px;" + "color: " + this.text_color + ";"; - this.text2.set_position(this.text1.get_width() + (2 * unit_size), unit_size); + this.text2.set_position(this.text1.get_width() + (2 * unit_size), (2.5 * unit_size) - this.text2.get_height()); this.text2.set_text(text2); this.text2.style = "font-size: " + text2_size + "px;" + "color: " + this.text_color + ";"; this.text3.set_text(text3); this.text3.style = "font-size: " + text3_size + "px;" + "color: " + this.text_color + ";"; - this.text3.set_position((21 * unit_size) - this.text3.get_width(), unit_size * 1.3333); + this.text3.set_position((21 * unit_size) - this.text3.get_width(), (2.5 * unit_size) - this.text3.get_height()); // update canvas