Merge pull request #864 from labarks/master

Update widver to 0.02
pull/868/head
Gordon Williams 2021-10-28 09:10:22 +01:00 committed by GitHub
commit c582e8dfc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -1633,7 +1633,7 @@
{ {
"id": "widver", "id": "widver",
"name": "Firmware Version Widget", "name": "Firmware Version Widget",
"version": "0.01", "version": "0.02",
"description": "Display the version of the installed firmware in the top widget section.", "description": "Display the version of the installed firmware in the top widget section.",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",

View File

@ -1 +1,2 @@
0.01: New Widget 0.01: New Widget
0.02: Display "Rel" (Release) instead of 'undefined' when there is no Build number.

View File

@ -2,6 +2,10 @@
(() => { (() => {
var width = 28, var width = 28,
ver = process.env.VERSION.split('.'); ver = process.env.VERSION.split('.');
// Example: if ver is 2v11 instead of 2v10.142 write "Rel" (Release) instead of Build number
if(typeof ver[1] === 'undefined'){ver[1] = "Rel";}
function draw() { function draw() {
g.reset().setColor(0, 0.5, 1).setFont("6x8", 1); g.reset().setColor(0, 0.5, 1).setFont("6x8", 1);
g.drawString(ver[0], this.x + 2, this.y + 4, true); g.drawString(ver[0], this.x + 2, this.y + 4, true);