From 39418b43dd5e4593152d653eab192199fba3852d Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 19 Dec 2022 10:26:37 +0000 Subject: [PATCH] 0.08: Don't completely remove the lock widget when screen unlocked (use 1px) to ensure appRect/drawWidgets still thinks there are widgets (fix #2409, #2413) --- apps/widlock/ChangeLog | 1 + apps/widlock/metadata.json | 2 +- apps/widlock/widget.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/widlock/ChangeLog b/apps/widlock/ChangeLog index 665750150..abceba48e 100644 --- a/apps/widlock/ChangeLog +++ b/apps/widlock/ChangeLog @@ -5,3 +5,4 @@ 0.05: Set sortorder to -10 so that others can take -1 etc 0.06: Set sortorder to -10 in widget code 0.07: Remove check for .isLocked (extremely old firmwares), speed up widget loading +0.08: Don't completely remove the lock widget when screen unlocked (use 1px) to ensure appRect/drawWidgets still thinks there are widgets diff --git a/apps/widlock/metadata.json b/apps/widlock/metadata.json index db532851a..509a5b7a5 100644 --- a/apps/widlock/metadata.json +++ b/apps/widlock/metadata.json @@ -1,7 +1,7 @@ { "id": "widlock", "name": "Lock Widget", - "version": "0.07", + "version": "0.08", "description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked", "icon": "widget.png", "type": "widget", diff --git a/apps/widlock/widget.js b/apps/widlock/widget.js index abcedde20..b5787e09d 100644 --- a/apps/widlock/widget.js +++ b/apps/widlock/widget.js @@ -1,8 +1,8 @@ Bangle.on("lock", function() { - WIDGETS["lock"].width = Bangle.isLocked()?16:0; + WIDGETS["lock"].width = Bangle.isLocked()?16:1; Bangle.drawWidgets(); }); -WIDGETS["lock"]={area:"tl",sortorder:10,width:Bangle.isLocked()?16:0,draw:function(w) { +WIDGETS["lock"]={area:"tl",sortorder:10,width:Bangle.isLocked()?16:1,draw:function(w) { if (Bangle.isLocked()) g.reset().drawImage(atob("DhABH+D/wwMMDDAwwMf/v//4f+H/h/8//P/z///f/g=="), w.x+1, w.y+4); }};