1
0
Fork 0

cogclock: setUI before loading widgets

master
Richard de Boer 2022-04-12 00:38:12 +02:00
parent 30dd8512ed
commit 9cf64f5d98
No known key found for this signature in database
GPG Key ID: 8721727971871937
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,9 @@ Graphics.prototype.setFont16x32N = function() {
), "0".charCodeAt(0), 16, 32);
};
Bangle.loadWidgets();
Bangle.setUI("clock"); // set UI first, so widgets know about Bangle.CLOCK
Bangle.loadWidgets(); // load widgets, so Bangle.appRect knows about them
const r1 = 84, // inner radius
r3 = Math.min(Bangle.appRect.w/2, Bangle.appRect.h/2), // outer radius
r2 = (r1*3+r3*2)/5,
@ -99,7 +101,6 @@ function draw() {
}
g.clear();
Bangle.drawWidgets();
Bangle.setUI("clock");
Bangle.on("lcdPower", on => {
if (timeOut) {
clearTimeout(timeOut);