cliclocks - Load widgets after Bangle.setUI to ensure widgets know if they're on a clock or not (fix #970)

pull/1047/head
Gordon Williams 2021-12-09 17:08:18 +00:00
parent 59b06d5aef
commit 845a962005
5 changed files with 15 additions and 12 deletions

View File

@ -1755,7 +1755,7 @@
"id": "cliock",
"name": "Commandline-Clock",
"shortName": "CLI-Clock",
"version": "0.14",
"version": "0.15",
"description": "Simple CLI-Styled Clock",
"icon": "app.png",
"screenshots": [{"url":"screenshot_cli.png"}],
@ -4422,7 +4422,7 @@
"id": "cliclockJS2Enhanced",
"name": "Commandline-Clock JS2 Enhanced",
"shortName": "CLI-Clock JS2",
"version": "0.02",
"version": "0.03",
"description": "Simple CLI-Styled Clock with enhancements. Modes that are hard to use and unneded are removed (BPM, battery info, memory ect) credit to hughbarney for the original code and design. Also added HID media controlls, just swipe on the clock face to controll the media! Gadgetbride support coming soon(hopefully) Thanks to t0m1o1 for media controls!",
"icon": "app.png",
"screenshots": [{"url":"screengrab.png"}],

View File

@ -1,2 +1,3 @@
0.01: Submitted to App Loader
0.02: Removed unneded code, added HID controlls thanks to t0m1o1 for his code :p
0.03: Load widgets after Bangle.setUI to ensure widgets know if they're on a clock or not (fix #970)

View File

@ -50,7 +50,7 @@ if (next) {
setTimeout(drawApp, 1000);
Bangle.setLocked(true);
}, BTN1, { edge:"falling",repeat:true,debounce:50});
Bangle.on('drag', function(e) {
Bangle.on('drag', function(e) {
if(!e.b){
console.log(lasty);
console.log(lastx);
@ -91,7 +91,7 @@ if (next) {
lasty = lasty + e.dy;
}
});
}
@ -144,14 +144,15 @@ function writeLine(str,line){
}
g.clear();
Bangle.loadWidgets();
Bangle.drawWidgets();
drawAll();
Bangle.on('lcdPower',function(on) {
if (on) drawAll();
});
var click = setInterval(updateTime, 1000);
// Show launcher when button pressed
Bangle.setUI("clockupdown", btn=>{
drawAll();
drawAll(); // why do we redraw here??
});
Bangle.loadWidgets();
Bangle.drawWidgets();
drawAll();

View File

@ -7,3 +7,4 @@
0.13: Use setUI, work with smaller screens and themes
0.14: Fix BTN1 (fix #853)
Add light/dark theme support
0.15: Load widgets after Bangle.setUI to ensure widgets know if they're on a clock or not (fix #970)

View File

@ -183,9 +183,6 @@ Bangle.on('HRM', function(hrm) {
});
g.clear();
Bangle.loadWidgets();
Bangle.drawWidgets();
drawAll();
Bangle.on('lcdPower',function(on) {
if (on) drawAll();
});
@ -195,4 +192,7 @@ Bangle.setUI("clockupdown", btn=>{
if (btn<0) changeInfoMode();
if (btn>0) changeFunctionMode();
drawAll();
});
});
Bangle.loadWidgets();
Bangle.drawWidgets();
drawAll();