forked from FOSS/BangleApps
Small fixes
parent
b632c232aa
commit
7e2f03adb1
|
@ -6,3 +6,4 @@
|
||||||
0.20: Add theme support
|
0.20: Add theme support
|
||||||
0.21: Add Settings
|
0.21: Add Settings
|
||||||
0.22: Use default Bangle formatter for booleans
|
0.22: Use default Bangle formatter for booleans
|
||||||
|
0.23: Small fixes
|
||||||
|
|
|
@ -229,7 +229,8 @@ function draw() {
|
||||||
//DATE
|
//DATE
|
||||||
var localDate = require("locale").date(new Date(), 1);
|
var localDate = require("locale").date(new Date(), 1);
|
||||||
localDate = localDate.substring(0, localDate.length - 5);
|
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);
|
g.setFont(font, primaryDateFontSize);
|
||||||
// set gmt to UTC+0
|
// set gmt to UTC+0
|
||||||
|
@ -253,22 +254,19 @@ function draw() {
|
||||||
g.setFont(font, secondaryTimeZoneFontSize).drawString(date, xyCenter, yposDate, true);
|
g.setFont(font, secondaryTimeZoneFontSize).drawString(date, xyCenter, yposDate, true);
|
||||||
} else if (index < 3) {
|
} else if (index < 3) {
|
||||||
// For > 1 extra timezones, render as columns / rows
|
// For > 1 extra timezones, render as columns / rows
|
||||||
g.setFont(font, secondaryRowColFontSize);
|
g.setFont(font, secondaryRowColFontSize).setFontAlign(-1, 0);
|
||||||
g.setFontAlign(-1, 0);
|
|
||||||
g.drawString(
|
g.drawString(
|
||||||
offset[OFFSET_TIME_ZONE],
|
offset[OFFSET_TIME_ZONE],
|
||||||
xcol1,
|
xcol1,
|
||||||
yposWorld + index * 15,
|
yposWorld + index * 15,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
g.setFontAlign(1, 0);
|
g.setFontAlign(1, 0).drawString(`${hours}:${minutes}`, xcol2, yposWorld + index * 15, true);
|
||||||
g.drawString(`${hours}:${minutes}`, xcol2, yposWorld + index * 15, true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (showSunInfo) {
|
if (showSunInfo) {
|
||||||
g.setFontAlign(-1, 0);
|
g.setFontAlign(-1, 0).setFont("Vector",12).drawString(`^${rise}`, 10, 3 + yposWorld + 3 * 15, true); // draw riseset
|
||||||
g.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
|
g.setFontAlign(1, 0).drawString(`v${set}`, xcol2, 3 + yposWorld + 3 * 15, true); // draw riseset
|
||||||
}
|
}
|
||||||
//debug settings
|
//debug settings
|
||||||
|
@ -277,7 +275,6 @@ function draw() {
|
||||||
//g.drawString(showSunInfo, xcol2, 3 + yposWorld + 3 * 15, true);
|
//g.drawString(showSunInfo, xcol2, 3 + yposWorld + 3 * 15, true);
|
||||||
//g.drawString(colorWhenDark, xcol2, 3 + yposWorld + 3 * 15, true);
|
//g.drawString(colorWhenDark, xcol2, 3 + yposWorld + 3 * 15, true);
|
||||||
|
|
||||||
|
|
||||||
queueDraw();
|
queueDraw();
|
||||||
|
|
||||||
if (secondsMode != "none") queueDrawSeconds();
|
if (secondsMode != "none") queueDrawSeconds();
|
||||||
|
@ -303,6 +300,7 @@ if (!Bangle.isLocked()) { // Initial state
|
||||||
if (showSunInfo) {
|
if (showSunInfo) {
|
||||||
if (PosInterval != 0) clearInterval(PosInterval);
|
if (PosInterval != 0) clearInterval(PosInterval);
|
||||||
PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins
|
PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins
|
||||||
|
updatePos();
|
||||||
}
|
}
|
||||||
|
|
||||||
secondsTimeout = 1000;
|
secondsTimeout = 1000;
|
||||||
|
@ -312,9 +310,8 @@ if (!Bangle.isLocked()) { // Initial state
|
||||||
}
|
}
|
||||||
if (drawTimeout) clearTimeout(drawTimeout);
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
drawTimeout = undefined;
|
drawTimeout = undefined;
|
||||||
|
|
||||||
draw(); // draw immediately, queue redraw
|
draw(); // draw immediately, queue redraw
|
||||||
if (showSunInfo) updatePos();
|
|
||||||
}else{
|
}else{
|
||||||
if (secondsMode == "always") secondsTimeout = 1000;
|
if (secondsMode == "always") secondsTimeout = 1000;
|
||||||
if (secondsMode == "when unlocked") secondsTimeout = 10 * 1000;
|
if (secondsMode == "when unlocked") secondsTimeout = 10 * 1000;
|
||||||
|
@ -329,21 +326,21 @@ if (!Bangle.isLocked()) { // Initial state
|
||||||
if (showSunInfo) {
|
if (showSunInfo) {
|
||||||
if (PosInterval != 0) clearInterval(PosInterval);
|
if (PosInterval != 0) clearInterval(PosInterval);
|
||||||
PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins
|
PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins
|
||||||
|
updatePos();
|
||||||
}
|
}
|
||||||
draw(); // draw immediately, queue redraw
|
draw(); // draw immediately, queue redraw
|
||||||
if (showSunInfo) updatePos();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bangle.on('lock',on=>{
|
Bangle.on('lock',on=>{
|
||||||
if (!on) { // UNlocked
|
if (!on) { // UNlocked
|
||||||
if (showSunInfo) {
|
if (showSunInfo) {
|
||||||
if (PosInterval != 0) clearInterval(PosInterval);
|
if (PosInterval != 0) clearInterval(PosInterval);
|
||||||
PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins
|
PosInterval = setInterval(updatePos, 60*10E3); // refesh every 10 mins
|
||||||
|
updatePos();
|
||||||
}
|
}
|
||||||
|
|
||||||
secondsTimeout = 1000;
|
secondsTimeout = 1000;
|
||||||
if (secondsMode != "none") {
|
if (secondsMode != "none") {
|
||||||
if (drawTimeoutSeconds) clearTimeout(drawTimeoutSeconds);
|
if (drawTimeoutSeconds) clearTimeout(drawTimeoutSeconds);
|
||||||
|
@ -353,7 +350,6 @@ Bangle.on('lock',on=>{
|
||||||
drawTimeout = undefined;
|
drawTimeout = undefined;
|
||||||
|
|
||||||
draw(); // draw immediately, queue redraw
|
draw(); // draw immediately, queue redraw
|
||||||
if (showSunInfo) updatePos();
|
|
||||||
}else{ // locked
|
}else{ // locked
|
||||||
|
|
||||||
if (secondsMode == "always") secondsTimeout = 1000;
|
if (secondsMode == "always") secondsTimeout = 1000;
|
||||||
|
@ -369,8 +365,8 @@ Bangle.on('lock',on=>{
|
||||||
if (showSunInfo) {
|
if (showSunInfo) {
|
||||||
if (PosInterval != 0) clearInterval(PosInterval);
|
if (PosInterval != 0) clearInterval(PosInterval);
|
||||||
PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins
|
PosInterval = setInterval(updatePos, 60*60E3); // refesh every 60 mins
|
||||||
|
updatePos();
|
||||||
}
|
}
|
||||||
draw(); // draw immediately, queue redraw
|
draw(); // draw immediately, queue redraw
|
||||||
if (showSunInfo) updatePos();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "hworldclock",
|
"id": "hworldclock",
|
||||||
"name": "Hanks World Clock",
|
"name": "Hanks World Clock",
|
||||||
"shortName": "Hanks World Clock",
|
"shortName": "Hanks World Clock",
|
||||||
"version": "0.22",
|
"version": "0.23",
|
||||||
"description": "Current time zone plus up to three others",
|
"description": "Current time zone plus up to three others",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
Loading…
Reference in New Issue