1
0
Fork 0

Merge pull request #1828 from idavydov/widbt_pr

[apps/widbthide] bluetooth widget which hides upon no connection
master
Gordon Williams 2022-05-19 08:59:14 +01:00 committed by GitHub
commit b2f01faf48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

View File

@ -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"}
]
}

13
apps/widbthide/widget.js Normal file
View File

@ -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);

BIN
apps/widbthide/widget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB