Update pebble.settings.js

pull/1639/head
sir-indy 2022-03-29 12:39:55 +01:00 committed by GitHub
parent aba96398f1
commit 24689a7684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -2,7 +2,7 @@
const SETTINGS_FILE = "pebble.json";
// initialize with default settings...
let s = {'bg': '#0f0', 'color': 'Green'}
let s = {'bg': '#0f0', 'color': 'Green', 'theme':'System'}
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
@ -20,6 +20,7 @@
var color_options = ['Green','Orange','Cyan','Purple','Red','Blue'];
var bg_code = ['#0f0','#ff0','#0ff','#f0f','#f00','#00f'];
var theme_options = ['System', 'Light', 'Dark'];
E.showMenu({
'': { 'title': 'Pebble Clock' },
@ -33,6 +34,14 @@
s.bg = bg_code[v];
save();
},
'Theme': {
value: 0 | theme_options.indexOf(s.theme),
min: 0, max: theme_options.length - 1,
format: v => theme_options[v],
onchange: v => {
s.theme = theme_options[v];
save();
},
}
});
})