Merge pull request #2236 from halemmerich/iconlaunch

Iconlaunch - Better timeout handling
pull/2254/head^2
Gordon Williams 2022-11-09 09:01:07 +00:00 committed by GitHub
commit e996879f0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -12,3 +12,5 @@
used Object.assing for the settings
fix cache not deleted when "showClocks" options is changed
added timeOut to return to the clock
0.11: Cleanup timeout when changing to clock
Reset timeout on swipe and drag

View File

@ -9,7 +9,6 @@
timeOut:"Off"
}, s.readJSON("iconlaunch.json", true) || {});
console.log(settings);
if (!settings.fullscreen) {
Bangle.loadWidgets();
Bangle.drawWidgets();
@ -133,6 +132,7 @@
g.flip();
const itemsN = Math.ceil(launchCache.apps.length / appsN);
let onDrag = function(e) {
updateTimeout();
g.setColor(g.theme.fg);
g.setBgColor(g.theme.bg);
let dy = e.dy;
@ -182,6 +182,7 @@
drag: onDrag,
touch: (_, e) => {
if (e.y < R.y - 4) return;
updateTimeout();
let i = YtoIdx(e.y);
selectItem(i, e);
},
@ -202,16 +203,23 @@
delete idxToY;
delete YtoIdx;
delete settings;
if (timeout) clearTimeout(timeout);
setTimeout(eval, 0, s.read(".bootcde"));
};
if (settings.oneClickExit) mode.btn = returnToClock;
let timeout;
const updateTimeout = function(){
if (settings.timeOut!="Off"){
let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt
setTimeout(returnToClock,time*1000);
if (timeout) clearTimeout(timeout);
timeout = setTimeout(returnToClock,time*1000);
}
}
updateTimeout();
Bangle.setUI(mode);
}

View File

@ -2,7 +2,7 @@
"id": "iconlaunch",
"name": "Icon Launcher",
"shortName" : "Icon launcher",
"version": "0.10",
"version": "0.11",
"icon": "app.png",
"description": "A launcher inspired by smartphones, with an icon-only scrollable menu.",
"tags": "tool,system,launcher",