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