1
0
Fork 0

powermanager - Fix drawing in timeout

master
Martin Boonk 2023-02-20 20:55:33 +01:00
parent bef8013342
commit b334b14f40
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ currently-running apps */
let brightnessSetting = settings.brightness || 1;
Bangle.setLCDBrightness = ((o) => (a) => {
brightnessSetting = a;
draw();
draw(WIDGETS.powermanager);
return o(a);
})(Bangle.setLCDBrightness);
@ -25,7 +25,7 @@ currently-running apps */
return process.HWVERSION == 2 ? (brightnessSetting * APPROX_BACKLIGHT) : (brightnessSetting * 0.9 * 33 + 7);
};
function draw() {
function draw(w) {
g.reset();
g.clearRect(this.x, this.y, this.x + 23, this.y + 23);
@ -63,7 +63,7 @@ currently-running apps */
}
this.timeoutId = setTimeout(() => {
this.timeoutId = undefined;
this.draw();
w.draw(w);
}, Bangle.isLocked() ? 60000 : 5000);
}