miclock2: first setui, then widgets

pull/2908/head
Erik Andresen 2023-07-25 19:32:14 +02:00
parent 09cc9f2fd5
commit d0551568bb
1 changed files with 5 additions and 6 deletions

View File

@ -48,7 +48,6 @@ const setLineWidth = function(x1, y1, x2, y2, lw) {
}; };
const drawMixedClock = function() { const drawMixedClock = function() {
"ram";
const date = new Date(); const date = new Date();
const dateArray = date.toString().split(" "); const dateArray = date.toString().split(" ");
const isEn = locale.name.startsWith("en"); const isEn = locale.name.startsWith("en");
@ -113,11 +112,6 @@ const onLCDPower = function(on) {
}; };
Bangle.on('lcdPower', onLCDPower); Bangle.on('lcdPower', onLCDPower);
g.clear();
Bangle.loadWidgets();
Bangle.drawWidgets();
drawMixedClock(); // immediately draw
Bangle.setUI({mode:"clock", remove:function() { Bangle.setUI({mode:"clock", remove:function() {
if (timeoutId !== undefined) { if (timeoutId !== undefined) {
delete buf.buffer; delete buf.buffer;
@ -126,4 +120,9 @@ Bangle.setUI({mode:"clock", remove:function() {
Bangle.removeListener('lcdPower',onLCDPower); Bangle.removeListener('lcdPower',onLCDPower);
} }
}}); }});
g.clear();
Bangle.loadWidgets();
Bangle.drawWidgets();
drawMixedClock(); // immediately draw
} }