Skip to content

Commit c28b6d3

Browse files
author
thyttan
committed
launch: refactor fullscreen to load and hide widgets
1 parent 97d86e6 commit c28b6d3

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

apps/launch/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222
0.20: Use Bangle.showClock for changing to clock
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+
25-
0.23: Draw a placeholder screen right at the start to speed up apparent boot time
25+
0.23: Draw a placeholder screen right at the start to speed up apparent boot time
26+
0.24: Fix fullscreen when fastloading the launcher. (TODO:fix back btn flicker)

apps/launch/app.js

Lines changed: 12 additions & 3 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) {
@@ -54,7 +57,7 @@
5457

5558

5659
const drawMenu = () => {
57-
E.showScroller({
60+
let scroller = E.showScroller({
5861
h : height, c : apps.length,
5962
draw : (i, r) => {
6063
var app = apps[i];
@@ -81,8 +84,14 @@
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) require("widget_utils").show();
8489
}
8590
});
91+
if (settings.fullscreen) {
92+
require("widget_utils").hide();
93+
scroller.draw(); // FIX: The red back button will flicker before the widget is hidden and scroller redrawn.
94+
}
8695
g.flip(); // force a render before widgets have finished drawing
8796

8897
// 10s of inactivity goes back to clock
@@ -100,4 +109,4 @@
100109

101110
if (!settings.fullscreen) // finally draw widgets
102111
Bangle.drawWidgets();
103-
}
112+
}

apps/launch/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "launch",
33
"name": "Launcher",
44
"shortName": "Launcher",
5-
"version": "0.23",
5+
"version": "0.24",
66
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
77
"readme": "README.md",
88
"icon": "app.png",

0 commit comments

Comments
 (0)