BangleApps/apps/dtlaunch/settings-b2.js

61 lines
1.4 KiB
JavaScript
Raw Normal View History

(function(back) {
var FILE = "dtlaunch.json";
var settings = Object.assign({
showClocks: true,
showLaunchers: true,
direct: false,
swipeExit: false,
timeOut: "Off"
}, require('Storage').readJSON(FILE, true) || {});
function writeSettings() {
require('Storage').writeJSON(FILE, settings);
}
const timeOutChoices = [/*LANG*/"Off", "10s", "15s", "20s", "30s"];
E.showMenu({
"" : { "title" : "Desktop launcher" },
/*LANG*/"< Back" : () => back(),
/*LANG*/'Show clocks': {
value: settings.showClocks,
onchange: v => {
settings.showClocks = v;
writeSettings();
}
},
/*LANG*/'Show launchers': {
value: settings.showLaunchers,
onchange: v => {
settings.showLaunchers = v;
writeSettings();
}
},
/*LANG*/'Direct launch': {
value: settings.direct,
onchange: v => {
settings.direct = v;
writeSettings();
}
},
/*LANG*/'Swipe Exit': {
value: settings.swipeExit,
onchange: v => {
settings.swipeExit = v;
writeSettings();
}
},
2022-11-06 18:59:04 +00:00
/*LANG*/'Time Out': { // Adapted from Icon Launcher
value: timeOutChoices.indexOf(settings.timeOut),
min: 0,
max: timeOutChoices.length-1,
format: v => timeOutChoices[v],
2022-11-06 19:20:51 +00:00
onchange: v => {
settings.timeOut = timeOutChoices[v];
writeSettings();
}
}
});
2022-11-06 19:20:51 +00:00
});