diff --git a/apps/hworldclock/ChangeLog b/apps/hworldclock/ChangeLog index 199393d2a..8a2c0fec4 100644 --- a/apps/hworldclock/ChangeLog +++ b/apps/hworldclock/ChangeLog @@ -6,3 +6,4 @@ 0.20: Add theme support 0.21: Add Settings 0.22: Use default Bangle formatter for booleans +0.23: Small fixes diff --git a/apps/hworldclock/app.js b/apps/hworldclock/app.js index c41706d07..f7444d319 100644 --- a/apps/hworldclock/app.js +++ b/apps/hworldclock/app.js @@ -229,7 +229,8 @@ function draw() { //DATE var localDate = require("locale").date(new Date(), 1); localDate = localDate.substring(0, localDate.length - 5); - g.setFont("Vector", 17).drawString(require("locale").dow(new Date(), 1).toUpperCase() + ", " + localDate, xyCenter, yposDate, true); + g.setFont("Vector", 17); + g.drawString(require("locale").dow(new Date(), 1).toUpperCase() + ", " + localDate, xyCenter, yposDate, true); g.setFont(font, primaryDateFontSize); // set gmt to UTC+0 @@ -253,22 +254,19 @@ function draw() { g.setFont(font, secondaryTimeZoneFontSize).drawString(date, xyCenter, yposDate, true); } else if (index < 3) { // For > 1 extra timezones, render as columns / rows - g.setFont(font, secondaryRowColFontSize); - g.setFontAlign(-1, 0); + g.setFont(font, secondaryRowColFontSize).setFontAlign(-1, 0); g.drawString( offset[OFFSET_TIME_ZONE], xcol1, yposWorld + index * 15, true ); - g.setFontAlign(1, 0); - g.drawString(`${hours}:${minutes}`, xcol2, yposWorld + index * 15, true); + g.setFontAlign(1, 0).drawString(`${hours}:${minutes}`, xcol2, yposWorld + index * 15, true); } }); if (showSunInfo) { - g.setFontAlign(-1, 0); - g.setFont("Vector",12).drawString(`^${rise}`, 10, 3 + yposWorld + 3 * 15, true); // draw riseset + g.setFontAlign(-1, 0).setFont("Vector",12).drawString(`^${rise}`, 10, 3 + yposWorld + 3 * 15, true); // draw riseset g.setFontAlign(1, 0).drawString(`v${set}`, xcol2, 3 + yposWorld + 3 * 15, true); // draw riseset } //debug settings @@ -277,7 +275,6 @@ function draw() { //g.drawString(showSunInfo, xcol2, 3 + yposWorld + 3 * 15, true); //g.drawString(colorWhenDark, xcol2, 3 + yposWorld + 3 * 15, true); - queueDraw(); if (secondsMode != "none") queueDrawSeconds(); @@ -303,6 +300,7 @@ if (!Bangle.isLocked()) { // Initial state if (showSunInfo) { if (PosInterval != 0) clearInterval(PosInterval); PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins + updatePos(); } secondsTimeout = 1000; @@ -312,9 +310,8 @@ if (!Bangle.isLocked()) { // Initial state } if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; - draw(); // draw immediately, queue redraw - if (showSunInfo) updatePos(); + }else{ if (secondsMode == "always") secondsTimeout = 1000; if (secondsMode == "when unlocked") secondsTimeout = 10 * 1000; @@ -329,21 +326,21 @@ if (!Bangle.isLocked()) { // Initial state if (showSunInfo) { if (PosInterval != 0) clearInterval(PosInterval); PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins + updatePos(); } draw(); // draw immediately, queue redraw - if (showSunInfo) updatePos(); + } - - - Bangle.on('lock',on=>{ if (!on) { // UNlocked if (showSunInfo) { if (PosInterval != 0) clearInterval(PosInterval); PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins + updatePos(); } + secondsTimeout = 1000; if (secondsMode != "none") { if (drawTimeoutSeconds) clearTimeout(drawTimeoutSeconds); @@ -353,7 +350,6 @@ Bangle.on('lock',on=>{ drawTimeout = undefined; draw(); // draw immediately, queue redraw - if (showSunInfo) updatePos(); }else{ // locked if (secondsMode == "always") secondsTimeout = 1000; @@ -369,8 +365,8 @@ Bangle.on('lock',on=>{ if (showSunInfo) { if (PosInterval != 0) clearInterval(PosInterval); PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins + updatePos(); } draw(); // draw immediately, queue redraw - if (showSunInfo) updatePos(); } }); \ No newline at end of file diff --git a/apps/hworldclock/metadata.json b/apps/hworldclock/metadata.json index 8f1eb5a3c..653cfc59c 100644 --- a/apps/hworldclock/metadata.json +++ b/apps/hworldclock/metadata.json @@ -2,7 +2,7 @@ "id": "hworldclock", "name": "Hanks World Clock", "shortName": "Hanks World Clock", - "version": "0.22", + "version": "0.23", "description": "Current time zone plus up to three others", "allow_emulator":true, "icon": "app.png",