diff --git a/apps.json b/apps.json index 736e010c4..880c17660 100644 --- a/apps.json +++ b/apps.json @@ -4680,7 +4680,7 @@ "name": "Charging Status", "shortName":"ChargingStatus", "icon": "widget.png", - "version":"0.1.18", + "version":"0.1.0", "type": "widget", "description": "A simple widget that shows up whenever the watch starts charging.", "tags": "widget", diff --git a/apps/widChargingStatus/ChangeLog b/apps/widChargingStatus/ChangeLog index d3175e1ab..16675015d 100644 --- a/apps/widChargingStatus/ChangeLog +++ b/apps/widChargingStatus/ChangeLog @@ -1 +1 @@ -0.1: First release. \ No newline at end of file +0.1.0: First release. \ No newline at end of file diff --git a/apps/widChargingStatus/widget.js b/apps/widChargingStatus/widget.js index 9978d0ef9..686a120db 100644 --- a/apps/widChargingStatus/widget.js +++ b/apps/widChargingStatus/widget.js @@ -1,30 +1,30 @@ (() => { - Bangle.on('charging', (charging) => { - if (charging) { - Bangle.buzz(); - } - Bangle.drawWidgets(); // re-layout widgets - g.flip(); - }); - const icon = require("heatshrink").decompress(atob("kEggIEBoAIC4ADFgIDCgYDDwADBg4DGh4DGj4DCn4DD/4gBv4DEBgP//4PBAYUB//+GQIDE/hDCAYf4AY3wAYXgAYxfHIYQDEOQUCAQI")); function draw() { g.reset(); - g.setColor("#FD0"); - //if (Bangle.isCharging()) { - g.drawImage(icon, this.x, this.y + 2, { - scale: 0.8125 - }); - //} + if (Bangle.isCharging()) { + g.setColor("#FD0"); + g.drawImage(icon, this.x, this.y + 1, { + scale: 0.6875 + }); + } } WIDGETS.chargingStatus = { area: 'tr', - width: 26, + width: 22, draw: draw, }; - - + Bangle.on('charging', (charging) => { + if (charging) { + Bangle.buzz(); + WIDGETS.chargingStatus.width = 22; + } else { + WIDGETS.chargingStatus.width = 0; + } + Bangle.drawWidgets(); // re-layout widgets + g.flip(); + }); })(); \ No newline at end of file