mirror of https://github.com/espruino/BangleApps
implemented "direct launch" and "one click exit" settings
parent
17f69da0b9
commit
2ef59c470f
|
@ -1 +1,2 @@
|
|||
0.01: Initial release
|
||||
0.02: implemented "direct launch" and "one click exit" settings
|
|
@ -1,5 +1,8 @@
|
|||
const s = require("Storage");
|
||||
const settings = s.readJSON("launch.json", true) || { showClocks: true, fullscreen: false };
|
||||
const settings = s.readJSON("launch.json", true) || { showClocks: true, fullscreen: false,direct:false,oneClickExit:false };
|
||||
|
||||
if( settings.oneClickExit)
|
||||
setWatch(_=> load(), BTN1);
|
||||
|
||||
if (!settings.fullscreen) {
|
||||
Bangle.loadWidgets();
|
||||
|
@ -107,6 +110,11 @@ function drawText(i) {
|
|||
function selectItem(id, e) {
|
||||
const iconN = E.clip(Math.floor((e.x - R.x) / itemSize), 0, appsN - 1);
|
||||
const appId = id * appsN + iconN;
|
||||
if( settings.direct && apps[appId])
|
||||
{
|
||||
load(apps[appId].src);
|
||||
return;
|
||||
}
|
||||
if (appId == selectedItem && apps[appId]) {
|
||||
const app = apps[appId];
|
||||
if (!app.src || s.read(app.src) === undefined) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "iconlaunch",
|
||||
"name": "Icon Launcher",
|
||||
"shortName" : "Icon launcher",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"icon": "app.png",
|
||||
"description": "A launcher inspired by smartphones, with an icon-only scrollable menu.",
|
||||
"tags": "tool,system,launcher",
|
||||
|
|
|
@ -22,6 +22,16 @@
|
|||
value: settings.fullscreen == true,
|
||||
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
|
||||
onchange: (m) => { save("fullscreen", m) }
|
||||
},
|
||||
/*LANG*/"Direct launch": {
|
||||
value: settings.direct == true,
|
||||
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
|
||||
onchange: (m) => { save("direct", m) }
|
||||
},
|
||||
/*LANG*/"One click exit": {
|
||||
value: settings.oneClickExit == true,
|
||||
format: v => v ? /*LANG*/"Yes" : /*LANG*/"No",
|
||||
onchange: (m) => { save("oneClickExit", m) }
|
||||
}
|
||||
};
|
||||
E.showMenu(appMenu);
|
||||
|
|
Loading…
Reference in New Issue