widlock: Handle new firmwares with 'lock' event
parent
d40c64a805
commit
ac75110504
|
|
@ -587,7 +587,7 @@
|
|||
{ "id": "widlock",
|
||||
"name": "Lock Widget",
|
||||
"icon": "widget.png",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked",
|
||||
"tags": "widget,lock",
|
||||
"type":"widget",
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
0.01: First commit
|
||||
0.02: Handle new firmwares with 'lock' event
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
(function(){
|
||||
Bangle.on('lcdPower', function(on) {
|
||||
WIDGETS["lock"].width = Bangle.isLCDOn()?0:16;
|
||||
Bangle.on(Bangle.isLocked?'lock':'lcdPower', function(on) {
|
||||
WIDGETS["lock"].width = Bangle.isLocked()?0:16;
|
||||
Bangle.drawWidgets();
|
||||
});
|
||||
WIDGETS["lock"]={area:"tl",width:Bangle.isLCDOn()?0:16,draw:function(w) {
|
||||
if (!Bangle.isLCDOn())
|
||||
if (Bangle.isLocked===undefined)
|
||||
Bangle.isLocked = Bangle.isLCDOn;
|
||||
WIDGETS["lock"]={area:"tl",width:Bangle.isLocked()?0:16,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);
|
||||
}};
|
||||
})()
|
||||
|
|
|
|||
Loading…
Reference in New Issue