Merge pull request #3788 from thyttan/launch

launch: fix fullscreen and showClocks setting
master
Gordon Williams 2025-04-01 12:53:09 +01:00 committed by GitHub
commit fe144348cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 4 deletions

View File

@ -23,4 +23,7 @@
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 Launcher when a custom font from 2v26+ is specified (fix #3787)
0.24: Fix Launcher when a custom font from 2v26+ is specified (fix #3787)
Fix fullscreen when fastloading the launcher. (TODO:fix back btn flicker)
Fix showClocks setting not taking effect by now clearing cache when
changing those settings.

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) {
@ -81,6 +84,8 @@
// 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 && settings.fullscreen) require("widget_utils").show();
}
});
g.flip(); // force a render before widgets have finished drawing
@ -100,4 +105,4 @@
if (!settings.fullscreen) // finally draw widgets
Bangle.drawWidgets();
}
}

View File

@ -10,6 +10,9 @@
settings[key] = value;
require("Storage").write("launch.json",settings);
}
function clearCache() {
require("Storage").erase("launch.cache.json")
}
const appMenu = {
"": { "title": /*LANG*/"Launcher" },
/*LANG*/"< Back": back,
@ -26,7 +29,10 @@
},
/*LANG*/"Show Clocks": {
value: settings.showClocks == true,
onchange: (m) => { save("showClocks", m) }
onchange: (m) => {
save("showClocks", m);
clearCache();
}
},
/*LANG*/"Fullscreen": {
value: settings.fullscreen == true,