implemented "direct launch" and "one click exit" settings

pull/1871/head
Rarder44 2022-05-24 10:18:03 +02:00
parent 17f69da0b9
commit 2ef59c470f
4 changed files with 21 additions and 2 deletions

View File

@ -1 +1,2 @@
0.01: Initial release
0.02: implemented "direct launch" and "one click exit" settings

View File

@ -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) {

View File

@ -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",

View File

@ -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);