taglaunch: Backport PR 2316 for launch

master
Erik Andresen 2022-11-28 19:33:50 +01:00
parent e8163a6f14
commit 03f40ffca1
3 changed files with 9 additions and 13 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Use Bangle.showClock for changing to clock (Backport from launch)

View File

@ -69,16 +69,6 @@ let tagKeys = Object.keys(tags).filter(tag => tag !== "clock" || settings.showCl
if (!settings.fullscreen)
Bangle.loadWidgets();
let returnToClock = function() {
// unload everything manually
// ... or we could just call `load();` but it will be slower
Bangle.setUI(); // remove scroller's handling
if (lockTimeout) clearTimeout(lockTimeout);
Bangle.removeListener("lock", lockHandler);
// now load the default clock - just call .bootcde as this has the code already
setTimeout(eval,0,s.read(".bootcde"));
};
let showTagMenu = (tag) => {
E.showScroller({
h : 64*scaleval, c : appsByTag[tag].length,
@ -121,7 +111,12 @@ let showMainMenu = () => {
let tag = tagKeys[i];
showTagMenu(tag);
},
back : returnToClock // button press or tap in top left calls returnToClock now
back : Bangle.showClock, // button press or tap in top left shows clock now
remove : () => {
// cleanup the timeout to not leave anything behind after being removed from ram
if (lockTimeout) clearTimeout(lockTimeout);
Bangle.removeListener("lock", lockHandler);
}
});
};
showMainMenu();
@ -134,7 +129,7 @@ let lockHandler = function(locked) {
if (lockTimeout) clearTimeout(lockTimeout);
lockTimeout = undefined;
if (locked) {
lockTimeout = setTimeout(returnToClock, 10000);
lockTimeout = setTimeout(Bangle.showClock, 10000);
}
};
Bangle.on("lock", lockHandler);

View File

@ -2,7 +2,7 @@
"id": "taglaunch",
"name": "Tag Launcher",
"shortName": "Taglauncher",
"version": "0.01",
"version": "0.02",
"description": "Launcher that puts all applications into submenus based on their tag. With many applications installed this can result in a faster application selection than the linear access of the default launcher.",
"readme": "README.md",
"icon": "app.png",