Merge pull request #161 from MaBecker/widget_version_and_build

add widget version
pull/168/head
Gordon Williams 2020-03-30 08:40:42 +01:00 committed by GitHub
commit 2eb6dc634a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View File

@ -836,5 +836,16 @@
{"name":"marioclock.app.js","url":"marioclock-app.js"},
{"name":"marioclock.img","url":"marioclock-icon.js","evaluate":true}
]
},
{ "id": "widver",
"name": "Firmware Version Widget",
"icon": "widget.png",
"version":"0.01",
"description": "Display the version of the installed firmware in the top widget section.",
"tags": "widget,tool,system",
"type":"widget",
"storage": [
{"name":"widver.wid.js","url":"widget.js"}
]
}
]

1
apps/widver/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: New Widget

11
apps/widver/widget.js Normal file
View File

@ -0,0 +1,11 @@
/* jshint esversion: 6 */
(() => {
var width = 28,
ver = process.env.VERSION.split('.');
function draw() {
g.reset().setColor(0, 0.5, 1).setFont("6x8", 1);
g.drawString(ver[0], this.x + 2, this.y + 4, true);
g.setFontAlign(0, -1, 0).drawString(ver[1], this.x + width / 2, this.y + 14, true);
}
WIDGETS["version"] = { area: "tr", width: width, draw: draw };
})();

BIN
apps/widver/widget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B