mirror of https://github.com/espruino/BangleApps
Merge pull request #2410 from rnist/hworldclock-single-offset-small
[Hank's World Clock] Setting for single extra timezone smallpull/2417/head
commit
9a6d85a22c
|
@ -16,3 +16,4 @@
|
|||
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
|
||||
0.32: Added setting to show single timezone small, like where multiple ones are configured
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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) {
|
||||
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;
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 : false),
|
||||
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"]),
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue