forked from FOSS/BangleApps
Merge pull request #1828 from idavydov/widbt_pr
[apps/widbthide] bluetooth widget which hides upon no connectionmaster
commit
b2f01faf48
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"id": "widbthide",
|
||||
"name": "Bluetooth Widget (hides when no connection)",
|
||||
"version": "0.01",
|
||||
"description": "Shows Bluetooth icon (when connected) in the top right of the clock",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
"tags": "widget,bluetooth",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"widbthide.wid.js","url":"widget.js"}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
WIDGETS["bluetooth"]={area:"tr",draw:function() {
|
||||
if (WIDGETS.bluetooth.width==0)
|
||||
return;
|
||||
g.reset();
|
||||
g.setColor((g.getBPP()>8) ? "#07f" : (g.theme.dark ? "#0ff" : "#00f"));
|
||||
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),2+this.x,2+this.y);
|
||||
},changed:function() {
|
||||
WIDGETS.bluetooth.width = NRF.getSecurityStatus().connected?15:0;
|
||||
Bangle.drawWidgets();
|
||||
},width:NRF.getSecurityStatus().connected?15:0
|
||||
};
|
||||
NRF.on('connect',WIDGETS.bluetooth.changed);
|
||||
NRF.on('disconnect',WIDGETS.bluetooth.changed);
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue