launch: refactor fullscreen to load and hide widgets

master
thyttan 2025-03-29 21:03:15 +01:00
parent 97d86e6c08
commit c28b6d3f9e
3 changed files with 15 additions and 5 deletions

View File

@ -23,3 +23,4 @@
0.21: Make the "App source not found" warning less buggy
0.22: Add less padding between launcher items, use new font if available in 2v26+
0.23: Draw a placeholder screen right at the start to speed up apparent boot time
0.24: Fix fullscreen when fastloading the launcher. (TODO:fix back btn flicker)

View File

@ -22,8 +22,11 @@
let height = 50*scaleval;
// Now apps list is loaded - render
if (!settings.fullscreen)
if (!settings.fullscreen) {
Bangle.loadWidgets();
} else if (global.WIDGETS) {
require("widget_utils").hide();
}
let R = Bangle.appRect;
g.reset().clearRect(R).setColor("#888");
for (var y=R.y;y<R.y2;y+=height) {
@ -54,7 +57,7 @@
const drawMenu = () => {
E.showScroller({
let scroller = E.showScroller({
h : height, c : apps.length,
draw : (i, r) => {
var app = apps[i];
@ -81,8 +84,14 @@
// cleanup the timeout to not leave anything behind after being removed from ram
if (lockTimeout) clearTimeout(lockTimeout);
Bangle.removeListener("lock", lockHandler);
// Restore widgets if they were hidden by fullscreen setting
if (global.WIDGETS) require("widget_utils").show();
}
});
if (settings.fullscreen) {
require("widget_utils").hide();
scroller.draw(); // FIX: The red back button will flicker before the widget is hidden and scroller redrawn.
}
g.flip(); // force a render before widgets have finished drawing
// 10s of inactivity goes back to clock

View File

@ -2,7 +2,7 @@
"id": "launch",
"name": "Launcher",
"shortName": "Launcher",
"version": "0.23",
"version": "0.24",
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
"readme": "README.md",
"icon": "app.png",