Skip to content

Commit fe14434

Browse files
authored
Merge pull request #3788 from thyttan/launch
launch: fix fullscreen and showClocks setting
2 parents ebbe420 + 144d938 commit fe14434

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

apps/launch/ChangeLog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@
2323
0.21: Make the "App source not found" warning less buggy
2424
0.22: Add less padding between launcher items, use new font if available in 2v26+
2525
0.23: Draw a placeholder screen right at the start to speed up apparent boot time
26-
0.24: Fix Launcher when a custom font from 2v26+ is specified (fix #3787)
26+
0.24: Fix Launcher when a custom font from 2v26+ is specified (fix #3787)
27+
Fix fullscreen when fastloading the launcher. (TODO:fix back btn flicker)
28+
Fix showClocks setting not taking effect by now clearing cache when
29+
changing those settings.

apps/launch/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
let height = 50*scaleval;
2323

2424
// Now apps list is loaded - render
25-
if (!settings.fullscreen)
25+
if (!settings.fullscreen) {
2626
Bangle.loadWidgets();
27+
} else if (global.WIDGETS) {
28+
require("widget_utils").hide();
29+
}
2730
let R = Bangle.appRect;
2831
g.reset().clearRect(R).setColor("#888");
2932
for (var y=R.y;y<R.y2;y+=height) {
@@ -81,6 +84,8 @@
8184
// cleanup the timeout to not leave anything behind after being removed from ram
8285
if (lockTimeout) clearTimeout(lockTimeout);
8386
Bangle.removeListener("lock", lockHandler);
87+
// Restore widgets if they were hidden by fullscreen setting
88+
if (global.WIDGETS && settings.fullscreen) require("widget_utils").show();
8489
}
8590
});
8691
g.flip(); // force a render before widgets have finished drawing
@@ -100,4 +105,4 @@
100105

101106
if (!settings.fullscreen) // finally draw widgets
102107
Bangle.drawWidgets();
103-
}
108+
}

apps/launch/settings.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
settings[key] = value;
1111
require("Storage").write("launch.json",settings);
1212
}
13+
function clearCache() {
14+
require("Storage").erase("launch.cache.json")
15+
}
1316
const appMenu = {
1417
"": { "title": /*LANG*/"Launcher" },
1518
/*LANG*/"< Back": back,
@@ -26,7 +29,10 @@
2629
},
2730
/*LANG*/"Show Clocks": {
2831
value: settings.showClocks == true,
29-
onchange: (m) => { save("showClocks", m) }
32+
onchange: (m) => {
33+
save("showClocks", m);
34+
clearCache();
35+
}
3036
},
3137
/*LANG*/"Fullscreen": {
3238
value: settings.fullscreen == true,

0 commit comments

Comments
 (0)