mirror of https://github.com/espruino/BangleApps
0.11: Change level for medium charge (50% -> 40%), and darken color on light themes as yellow was almost invisible
parent
5600d3e24d
commit
6ac1713122
|
@ -7,3 +7,4 @@
|
|||
0.08: Ensure battery updates every 60s even if LCD was on at boot and stays on
|
||||
0.09: Misc speed/memory tweaks
|
||||
0.10: Color changes due to the battery level
|
||||
0.11: Change level for medium charge (50% -> 40%), and darken color on light themes as yellow was almost invisible
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "widbat",
|
||||
"name": "Battery Level Widget",
|
||||
"version": "0.10",
|
||||
"version": "0.11",
|
||||
"description": "Show the current battery level and charging status in the top right of the clock",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
g.setColor(g.theme.fg).fillRect(x,y+2,x+s-4,y+21).clearRect(x+2,y+4,x+s-6,y+19).fillRect(x+s-3,y+10,x+s,y+14);
|
||||
var battery = E.getBattery();
|
||||
if(battery < 20) {g.setColor("#f00");}
|
||||
else if (battery < 50) {g.setColor("#ff0");}
|
||||
else if (battery < 40) {g.setColor(g.theme.dark ? "#ff0" : "#f80");}
|
||||
else {g.setColor("#0f0");}
|
||||
g.fillRect(x+4,y+6,x+4+battery*(s-12)/100,y+17);
|
||||
}};
|
||||
|
|
Loading…
Reference in New Issue