diff --git a/apps/widbt/ChangeLog b/apps/widbt/ChangeLog new file mode 100644 index 000000000..4c2132122 --- /dev/null +++ b/apps/widbt/ChangeLog @@ -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 diff --git a/apps/widbt/metadata.json b/apps/widbt/metadata.json new file mode 100644 index 000000000..e2d5082a5 --- /dev/null +++ b/apps/widbt/metadata.json @@ -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"} + ] +} diff --git a/apps/widbt/widget.js b/apps/widbt/widget.js new file mode 100644 index 000000000..c7ef8c0ad --- /dev/null +++ b/apps/widbt/widget.js @@ -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); diff --git a/apps/widbt/widget.png b/apps/widbt/widget.png new file mode 100644 index 000000000..1a884a62c Binary files /dev/null and b/apps/widbt/widget.png differ