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)

pull/2417/head
Gordon Williams 2022-12-19 10:26:37 +00:00
parent 5b6eed5f9c
commit 39418b43dd
3 changed files with 4 additions and 3 deletions

View File

@ -5,3 +5,4 @@
0.05: Set sortorder to -10 so that others can take -1 etc 0.05: Set sortorder to -10 so that others can take -1 etc
0.06: Set sortorder to -10 in widget code 0.06: Set sortorder to -10 in widget code
0.07: Remove check for .isLocked (extremely old firmwares), speed up widget loading 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

View File

@ -1,7 +1,7 @@
{ {
"id": "widlock", "id": "widlock",
"name": "Lock Widget", "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", "description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",

View File

@ -1,8 +1,8 @@
Bangle.on("lock", function() { Bangle.on("lock", function() {
WIDGETS["lock"].width = Bangle.isLocked()?16:0; WIDGETS["lock"].width = Bangle.isLocked()?16:1;
Bangle.drawWidgets(); 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()) 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); g.reset().drawImage(atob("DhABH+D/wwMMDDAwwMf/v//4f+H/h/8//P/z///f/g=="), w.x+1, w.y+4);
}}; }};