1
0
Fork 0

messagesoverlay - Fix overlay keeping the LCD on

master
Martin Boonk 2023-07-15 15:04:32 +02:00
parent 86f78c1f0b
commit 6915b8d4c3
3 changed files with 5 additions and 2 deletions

View File

@ -2,3 +2,4 @@
0.02: Fix touch/drag/swipe handlers not being restored correctly if a message is removed 0.02: Fix touch/drag/swipe handlers not being restored correctly if a message is removed
0.03: Scroll six lines per swipe, leaving the previous top/bottom row visible. 0.03: Scroll six lines per swipe, leaving the previous top/bottom row visible.
0.04: Use the event mechanism for getting messages 0.04: Use the event mechanism for getting messages
0.05: Fix the overlay keeping the LCD on

View File

@ -163,6 +163,7 @@ let showMessage = function(ovr, msg) {
}; };
let drawBorder = function(ovr) { let drawBorder = function(ovr) {
LOG("drawBorder", isQuiet());
if (Bangle.isLocked()) if (Bangle.isLocked())
ovr.setColor(ovr.theme.fgH); ovr.setColor(ovr.theme.fgH);
else else
@ -170,7 +171,6 @@ let drawBorder = function(ovr) {
ovr.drawRect(0,0,ovr.getWidth()-1,ovr.getHeight()-1); ovr.drawRect(0,0,ovr.getWidth()-1,ovr.getHeight()-1);
ovr.drawRect(1,1,ovr.getWidth()-2,ovr.getHeight()-2); ovr.drawRect(1,1,ovr.getWidth()-2,ovr.getHeight()-2);
show(ovr); show(ovr);
if (!isQuiet()) Bangle.setLCDPower(1);
}; };
let showCall = function(ovr, msg) { let showCall = function(ovr, msg) {
@ -432,6 +432,7 @@ let main = function(ovr, event) {
let ovr; let ovr;
exports.message = function(type, event) { exports.message = function(type, event) {
LOG("Got message", type, event);
// only handle some event types // only handle some event types
if(!(type=="text" || type == "call")) return; if(!(type=="text" || type == "call")) return;
if(type=="text" && event.id == "nav") return; if(type=="text" && event.id == "nav") return;
@ -456,6 +457,7 @@ exports.message = function(type, event) {
ovr.theme = { fg:0, bg:1, fg2:1, bg2:0, fgH:1, bgH:0 }; ovr.theme = { fg:0, bg:1, fg2:1, bg2:0, fgH:1, bgH:0 };
main(ovr, event); main(ovr, event);
if (!isQuiet()) Bangle.setLCDPower(1);
event.handled = true; event.handled = true;
g = _g; g = _g;
}; };

View File

@ -1,7 +1,7 @@
{ {
"id": "messagesoverlay", "id": "messagesoverlay",
"name": "Messages Overlay", "name": "Messages Overlay",
"version": "0.04", "version": "0.05",
"description": "An overlay based implementation of a messages UI (display notifications from iOS and Gadgetbridge/Android)", "description": "An overlay based implementation of a messages UI (display notifications from iOS and Gadgetbridge/Android)",
"icon": "app.png", "icon": "app.png",
"type": "bootloader", "type": "bootloader",