mirror of https://github.com/espruino/BangleApps
widminbt is now correct bt widget
parent
88740b52db
commit
144c8aabf8
|
@ -1 +1,2 @@
|
||||||
0.01: Initial Release
|
0.01: Initial Release
|
||||||
|
0.02: Proper provider bluetooth widget
|
|
@ -1,11 +1,12 @@
|
||||||
{
|
{
|
||||||
"id": "widminbt",
|
"id": "widminbt",
|
||||||
"name": "Minimal Bluetooth Widget",
|
"name": "Minimal Bluetooth Widget",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "Appears whenever bluetooth is disconnected",
|
"description": "Appears whenever bluetooth is disconnected",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"tags": "widget,bluetooth,minimal",
|
"tags": "widget,bluetooth,minimal",
|
||||||
|
"provides_widgets" : ["bluetooth"],
|
||||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"widminbt.wid.js","url":"widget.js"}
|
{"name":"widminbt.wid.js","url":"widget.js"}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
(()=> {
|
WIDGETS["bluetooth"] = {area: "tr", width: NRF.getSecurityStatus().connected ? 0 : 15, draw: function () {
|
||||||
WIDGETS.minbt={area:"tr",width:NRF.getSecurityStatus().connected?0:15,draw:function() {
|
if (WIDGETS.bluetooth.width < 15) return;
|
||||||
if(this.width<15)return;
|
|
||||||
g.reset();
|
g.reset();
|
||||||
g.setColor((g.getBPP()>8) ? "#07f" : (g.theme.dark ? "#0ff" : "#00f"));
|
g.setColor((g.getBPP()>8) ? "#07f" : (g.theme.dark ? "#0ff" : "#00f"));
|
||||||
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),2+this.x,2+this.y);
|
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),2+this.x,2+this.y);
|
||||||
g.setColor("#f00");
|
g.setColor("#f00");
|
||||||
g.drawImage(atob("CxSBAMA8DYG4YwxzBmD4DwHAGAeA8DcGYY4wzB2B4DA="), 2+this.x, 2+this.y);
|
g.drawImage(atob("CxSBAMA8DYG4YwxzBmD4DwHAGAeA8DcGYY4wzB2B4DA="), 2+this.x, 2+this.y);
|
||||||
},changed:function(){
|
},changed:function(){
|
||||||
WIDGETS.minbt.width=NRF.getSecurityStatus().connected?0:15;
|
WIDGETS.bluetooth.width=NRF.getSecurityStatus().connected?0:15;
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
}};
|
}};
|
||||||
NRF.on('connect',WIDGETS.minbt.changed);
|
NRF.on('connect', WIDGETS.bluetooth.changed);
|
||||||
NRF.on('disconnect',WIDGETS.minbt.changed);
|
NRF.on('disconnect', WIDGETS.bluetooth.changed);
|
||||||
})();
|
|
||||||
|
|
Loading…
Reference in New Issue