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