mirror of https://github.com/espruino/BangleApps
fix https://github.com/espruino/BangleApps/issues/953 - new lock widget
parent
1777799ae6
commit
45c5e15f20
|
@ -4,3 +4,4 @@
|
||||||
0.04: Set sortorder to -1 so that widget always takes up the furthest left position
|
0.04: Set sortorder to -1 so that widget always takes up the furthest left position
|
||||||
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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "widlock",
|
"id": "widlock",
|
||||||
"name": "Lock Widget",
|
"name": "Lock Widget",
|
||||||
"version": "0.06",
|
"version": "0.07",
|
||||||
"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",
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
(function(){
|
Bangle.on("lock", function() {
|
||||||
if (!Bangle.isLocked) return; // bail out on old firmware
|
|
||||||
Bangle.on("lock", function(on) {
|
|
||||||
WIDGETS["lock"].width = Bangle.isLocked()?16:0;
|
WIDGETS["lock"].width = Bangle.isLocked()?16:0;
|
||||||
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:0,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);
|
||||||
}};
|
}};
|
||||||
})()
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: First commit
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"id": "widlockunlock",
|
||||||
|
"name": "Lock/Unlock Widget",
|
||||||
|
"version": "0.01",
|
||||||
|
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked, or an unlock icon otherwise",
|
||||||
|
"icon": "widget.png",
|
||||||
|
"type": "widget",
|
||||||
|
"tags": "widget,lock",
|
||||||
|
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||||
|
"storage": [
|
||||||
|
{"name":"widlockunlock.wid.js","url":"widget.js"}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
Bangle.on("lockunlock", function() {
|
||||||
|
Bangle.drawWidgets();
|
||||||
|
});
|
||||||
|
WIDGETS["lockunlock"]={area:"tl",sortorder:10,width:14,draw:function(w) {
|
||||||
|
g.reset().drawImage(atob(Bangle.isLocked() ? "DBGBAAAA8DnDDCBCBP////////n/n/n//////z/A" : "DBGBAAAA8BnDDCBABP///8A8A8Y8Y8Y8A8A//z/A"), w.x+1, w.y+3);
|
||||||
|
}};
|
Binary file not shown.
After Width: | Height: | Size: 726 B |
Loading…
Reference in New Issue