From cf6ee6045f738cf3114419adbb1a61c25616a50f Mon Sep 17 00:00:00 2001 From: rnist Date: Sun, 18 Dec 2022 11:17:28 +0200 Subject: [PATCH 1/5] Update app.js --- apps/hworldclock/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hworldclock/app.js b/apps/hworldclock/app.js index 2eba0fb71..c5ab16b32 100644 --- a/apps/hworldclock/app.js +++ b/apps/hworldclock/app.js @@ -257,7 +257,7 @@ let draw = function() { minutes = doublenum(dx.getMinutes()); - if (offsets.length === 1) { + if (offsets.length === 1 && false) { let date = [require("locale").dow(new Date(), 1), require("locale").date(new Date(), 1)]; // For a single secondary timezone, draw it bigger and drop time zone to second line const xOffset = 30; From c873bbe0dd6c4aa55d145a6b25b22d4cdf286f08 Mon Sep 17 00:00:00 2001 From: rnist Date: Sun, 18 Dec 2022 11:59:07 +0200 Subject: [PATCH 2/5] Added setting to show single offset small, as if there is more than one --- apps/hworldclock/README.md | 1 + apps/hworldclock/app.js | 3 ++- apps/hworldclock/settings.js | 21 ++++++++++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/hworldclock/README.md b/apps/hworldclock/README.md index 273389775..d8343e5b9 100644 --- a/apps/hworldclock/README.md +++ b/apps/hworldclock/README.md @@ -9,6 +9,7 @@ All this is configurable: - Show seconds only when unlocked (saves battery) / always / do not show seconds - Green color on dark mode (on/off) + - 1 Offset Small: single location shows as small (like more than 1) - Show sun info (on/off) (set your location in the mylocation app) - Rotation degree on swipe (off / 90 / 180 / 270) diff --git a/apps/hworldclock/app.js b/apps/hworldclock/app.js index c5ab16b32..79e916ea9 100644 --- a/apps/hworldclock/app.js +++ b/apps/hworldclock/app.js @@ -104,6 +104,7 @@ let def = function(value, def) { let settings = require('Storage').readJSON(SETTINGSFILE, true) || {}; secondsMode = def(settings.secondsMode, "when unlocked"); showSunInfo = def(settings.showSunInfo, true); +singleOffsetSmall = def(settings.singleOffsetSmall, false); colorWhenDark = def(settings.colorWhenDark, "green"); rotationTarget = def(settings.rotationTarget, "90"); rotationTarget = parseInt(rotationTarget) || 0; @@ -257,7 +258,7 @@ let draw = function() { minutes = doublenum(dx.getMinutes()); - if (offsets.length === 1 && false) { + if (offsets.length === 1 && !singleOffsetSmall) { let date = [require("locale").dow(new Date(), 1), require("locale").date(new Date(), 1)]; // For a single secondary timezone, draw it bigger and drop time zone to second line const xOffset = 30; diff --git a/apps/hworldclock/settings.js b/apps/hworldclock/settings.js index ad97c161a..fd61baa76 100644 --- a/apps/hworldclock/settings.js +++ b/apps/hworldclock/settings.js @@ -36,13 +36,20 @@ "< Back": () => back(), "Seconds": stringInSettings("secondsMode", ["always", "when unlocked", "none"]), "Color w. dark": stringInSettings("colorWhenDark", ["green", "default"]), - "Show SunInfo": { - value: (settings.showSunInfo !== undefined ? settings.showSunInfo : true), - onchange: v => { - settings.showSunInfo = v; - writeSettings(); - } - }, + "1 Offset Small": { + value: (settings.singleOffsetSmall !== undefined ? settings.singleOffsetSmall : true), + onchange: v=> { + settings.singleOffsetSmall = v; + writeSettings(); + } + }, + "Show SunInfo": { + value: (settings.showSunInfo !== undefined ? settings.showSunInfo : true), + onchange: v => { + settings.showSunInfo = v; + writeSettings(); + } + }, "Rotation": stringInSettings("rotationTarget", ["off", "90", "180", "270"]), }; From d3e5a95854f19cc1a030d56674926212f8be4d74 Mon Sep 17 00:00:00 2001 From: rnist Date: Sun, 18 Dec 2022 12:06:16 +0200 Subject: [PATCH 3/5] Updated changelog --- apps/hworldclock/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/hworldclock/ChangeLog b/apps/hworldclock/ChangeLog index 87c7cf288..99727c50b 100644 --- a/apps/hworldclock/ChangeLog +++ b/apps/hworldclock/ChangeLog @@ -15,4 +15,5 @@ 0.29: Use 'modules/suncalc.js' to avoid it being copied 8 times for different apps 0.30: BJS2: swipe seems to be working now 0.31: Tweaking the swipe option; Added mylocation as a dependency. - Remove calls to Bangle.loadWidgets as they are not needed and create warnings \ No newline at end of file + Remove calls to Bangle.loadWidgets as they are not needed and create warnings +0.32: Added setting to show single timezone small, like where multiple ones are configured \ No newline at end of file From 419c123d6dd7c5f47b642b9449d43890bb9d90a4 Mon Sep 17 00:00:00 2001 From: rnist Date: Sun, 18 Dec 2022 12:07:22 +0200 Subject: [PATCH 4/5] Updated version --- apps/hworldclock/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hworldclock/metadata.json b/apps/hworldclock/metadata.json index 590f1dc86..fe5865ad0 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.31", + "version": "0.32", "description": "Current time zone plus up to three others", "allow_emulator":true, "icon": "app.png", From 8d06e3089800d5aca67ddd59dbd4826654549ecd Mon Sep 17 00:00:00 2001 From: rnist Date: Sun, 18 Dec 2022 12:20:20 +0200 Subject: [PATCH 5/5] Default single offset small to false in the menu --- apps/hworldclock/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hworldclock/settings.js b/apps/hworldclock/settings.js index fd61baa76..98b91dc7b 100644 --- a/apps/hworldclock/settings.js +++ b/apps/hworldclock/settings.js @@ -37,7 +37,7 @@ "Seconds": stringInSettings("secondsMode", ["always", "when unlocked", "none"]), "Color w. dark": stringInSettings("colorWhenDark", ["green", "default"]), "1 Offset Small": { - value: (settings.singleOffsetSmall !== undefined ? settings.singleOffsetSmall : true), + value: (settings.singleOffsetSmall !== undefined ? settings.singleOffsetSmall : false), onchange: v=> { settings.singleOffsetSmall = v; writeSettings();