widbt: recover original widbt

pull/1828/head
Iakov Davydov 2022-05-18 19:10:02 +02:00
parent a9839bed9e
commit 2c1a4e3003
4 changed files with 32 additions and 0 deletions

7
apps/widbt/ChangeLog Normal file
View File

@ -0,0 +1,7 @@
0.02: Tweaks for variable size widget system
0.03: Ensure redrawing works with variable size widget system
0.04: Fix automatic update of Bluetooth connection status
0.05: Make Bluetooth widget thinner, and when on a bright theme use light grey for disabled color
0.06: Tweaking colors for dark/light themes and low bpp screens
0.07: Memory usage improvements
0.08: Disable LCD on, on bluetooth status change

13
apps/widbt/metadata.json Normal file
View File

@ -0,0 +1,13 @@
{
"id": "widbt",
"name": "Bluetooth Widget",
"version": "0.08",
"description": "Show the current Bluetooth connection status in the top right of the clock",
"icon": "widget.png",
"type": "widget",
"tags": "widget,bluetooth",
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"widbt.wid.js","url":"widget.js"}
]
}

12
apps/widbt/widget.js Normal file
View File

@ -0,0 +1,12 @@
WIDGETS["bluetooth"]={area:"tr",width:15,draw:function() {
g.reset();
if (NRF.getSecurityStatus().connected)
g.setColor((g.getBPP()>8) ? "#07f" : (g.theme.dark ? "#0ff" : "#00f"));
else
g.setColor(g.theme.dark ? "#666" : "#999");
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),2+this.x,2+this.y);
},changed:function() {
WIDGETS["bluetooth"].draw();
}};
NRF.on('connect',WIDGETS["bluetooth"].changed);
NRF.on('disconnect',WIDGETS["bluetooth"].changed);

BIN
apps/widbt/widget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB