More fixes

pull/1993/head
Hank 2022-06-23 17:05:08 +02:00
parent 237cc63239
commit 127cb501b9
1 changed files with 27 additions and 29 deletions

View File

@ -27,7 +27,8 @@
var s = 29;
var x = this.x;
var y = this.y;
if ((typeof x === 'undefined') || (typeof y === 'undefined')) {
} else {
const l = E.getBattery();
let xl = x+4+l*(s-12)/100;
if (l != old_l){ // Delete the old value from screen
@ -44,8 +45,6 @@
}
//console.log(old_x);
old_x = this.x;
old_y = this.y;
g.setColor(levelColor(l));
g.fillRect(x+4,y+14+3,xl,y+16+3); // charging bar
@ -56,15 +55,14 @@
g.setFont('Vector',16);
g.drawString(l, x + 14, y + 10);
}
old_x = this.x;
old_y = this.y;
if (Bangle.isCharging()) changeInterval(id, intervalHigh);
else changeInterval(id, intervalLow);
}
Bangle.on('charging',function(charging) { draw(); });
var id = setInterval(()=>WIDGETS["wid_a_battery_widget"].draw(), intervalLow);