Skip to content

launch: fix fullscreen and showClocks setting #3788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/launch/ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 7 additions & 2 deletions apps/launch/app.js
Original file line number Diff line number Diff line change
@@ -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();
}
}
8 changes: 7 additions & 1 deletion apps/launch/settings.js
Original file line number Diff line number Diff line change
@@ -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,