make width smaller, default to not having width

pull/1003/head
Sebastian Di Luzio 2021-12-04 22:47:27 +01:00
parent cf36400faa
commit 9ad0ccd1bf
2 changed files with 4 additions and 4 deletions

View File

@ -4682,7 +4682,7 @@
"icon": "widget.png", "icon": "widget.png",
"version":"0.1.0", "version":"0.1.0",
"type": "widget", "type": "widget",
"description": "A simple widget that shows up whenever the watch starts charging.", "description": "A simple widget that shows a yellow lightning icon to indicate whenever the watch is charging. This way one can see if the watch is charging at a glance, no matter which battery widget is being used.",
"tags": "widget", "tags": "widget",
"supports": ["BANGLEJS","BANGLEJS2"], "supports": ["BANGLEJS","BANGLEJS2"],
"storage": [ "storage": [

View File

@ -1,5 +1,5 @@
(() => { (() => {
const icon = require("heatshrink").decompress(atob("kEggIEBoAIC4ADFgIDCgYDDwADBg4DGh4DGj4DCn4DD/4gBv4DEBgP//4PBAYUB//+GQIDE/hDCAYf4AY3wAYXgAYxfHIYQDEOQUCAQI")); const icon = require("heatshrink").decompress(atob("ikggMAiEAgYIBmEAg4EB+EAh0AgPggEeCAIEBnwQBAgP+gEP//x///j//8f//k///H//4BYOP/4lBv4bDvwEB4EAvAEBwEAuA7DCAI7BgAQBhEAA"));
function draw() { function draw() {
g.reset(); g.reset();
@ -13,14 +13,14 @@
WIDGETS.chargingStatus = { WIDGETS.chargingStatus = {
area: 'tr', area: 'tr',
width: 22, width: Bangle.isCharging() ? 20 : 0,
draw: draw, draw: draw,
}; };
Bangle.on('charging', (charging) => { Bangle.on('charging', (charging) => {
if (charging) { if (charging) {
Bangle.buzz(); Bangle.buzz();
WIDGETS.chargingStatus.width = 22; WIDGETS.chargingStatus.width = 20;
} else { } else {
WIDGETS.chargingStatus.width = 0; WIDGETS.chargingStatus.width = 0;
} }