antonclk/waveclk 0.02: Load widgets after setUI so widclk knows when to hide

pull/837/head^2
Gordon Williams 2021-10-06 10:15:16 +01:00
parent 48d8031442
commit 70702560c6
5 changed files with 11 additions and 10 deletions

View File

@ -3520,7 +3520,7 @@
{ "id": "antonclk", { "id": "antonclk",
"name": "Anton Clock", "name": "Anton Clock",
"icon": "app.png", "icon": "app.png",
"version":"0.01", "version":"0.02",
"description": "A simple clock using the bold Anton font.", "description": "A simple clock using the bold Anton font.",
"tags":"clock,b2", "tags":"clock,b2",
"type":"clock", "type":"clock",
@ -3533,7 +3533,7 @@
{ "id": "waveclk", { "id": "waveclk",
"name": "Wave Clock", "name": "Wave Clock",
"icon": "app.png", "icon": "app.png",
"version":"0.01", "version":"0.02",
"description": "A clock using a wave image by [Lillith May](https://www.instagram.com/_lilustrations_/). **Note: This requires a bugfix for #2049 on Bangle.js 1**", "description": "A clock using a wave image by [Lillith May](https://www.instagram.com/_lilustrations_/). **Note: This requires a bugfix for #2049 on Bangle.js 1**",
"tags":"clock,b2", "tags":"clock,b2",
"type":"clock", "type":"clock",

View File

@ -1 +1,2 @@
0.01: New App! 0.01: New App!
0.02: Load widgets after setUI so widclk knows when to hide

View File

@ -19,7 +19,7 @@ function queueDraw() {
function draw() { function draw() {
var x = g.getWidth()/2; var x = g.getWidth()/2;
var y = g.getHeight()/2; var y = g.getHeight()/2;
g.reset(); g.reset();
var date = new Date(); var date = new Date();
var timeStr = require("locale").time(date,1); var timeStr = require("locale").time(date,1);
var dateStr = require("locale").date(date).toUpperCase(); var dateStr = require("locale").date(date).toUpperCase();
@ -33,7 +33,7 @@ function draw() {
g.clearRect(0,y-8,g.getWidth(),y+8); // clear the background g.clearRect(0,y-8,g.getWidth(),y+8); // clear the background
g.drawString(dateStr,x,y); g.drawString(dateStr,x,y);
// queue draw in one minute // queue draw in one minute
queueDraw(); queueDraw();
} }
// Clear the screen once, at startup // Clear the screen once, at startup
@ -49,9 +49,8 @@ Bangle.on('lcdPower',on=>{
drawTimeout = undefined; drawTimeout = undefined;
} }
}); });
// Show launcher when middle button pressed
Bangle.setUI("clock");
// Load widgets // Load widgets
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
// Show launcher when middle button pressed
Bangle.setUI("clock");

View File

@ -1 +1,2 @@
0.01: New App! 0.01: New App!
0.02: Load widgets after setUI so widclk knows when to hide

View File

@ -28,7 +28,7 @@ function queueDraw() {
function draw() { function draw() {
var x = g.getWidth()/2; var x = g.getWidth()/2;
var y = 24+20; var y = 24+20;
g.reset().clearRect(0,24,g.getWidth(),g.getHeight()-IMAGEHEIGHT); g.reset().clearRect(0,24,g.getWidth(),g.getHeight()-IMAGEHEIGHT);
if (g.getWidth() == IMAGEWIDTH) if (g.getWidth() == IMAGEWIDTH)
g.drawImage(getImg(),0,g.getHeight()-IMAGEHEIGHT); g.drawImage(getImg(),0,g.getHeight()-IMAGEHEIGHT);
@ -65,8 +65,8 @@ Bangle.on('lcdPower',on=>{
drawTimeout = undefined; drawTimeout = undefined;
} }
}); });
// Show launcher when middle button pressed
Bangle.setUI("clock");
// Load widgets // Load widgets
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
// Show launcher when middle button pressed
Bangle.setUI("clock");