forked from FOSS/BangleApps
widminbat - Fix clearing outside of widget bar
parent
9dd40c9d64
commit
69527428c5
|
@ -1,3 +1,3 @@
|
|||
0.01: Initial Version: Display at under 30% battery
|
||||
0.02: Display while charging
|
||||
|
||||
0.03: Do not clear outside of widget bar
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ "id": "widminbat",
|
||||
"name": "Minimal Battery",
|
||||
"shortName":"MinBat",
|
||||
"version":"0.02",
|
||||
"version":"0.03",
|
||||
"description": "A minimal version of the battery widget that only appears if the battery is running low (below 30%)",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
var bat = E.getBattery();
|
||||
var x = this.x, y = this.y;
|
||||
g.reset();
|
||||
g.clearRect(x,y,x+s,y+24);
|
||||
g.clearRect(x,y,x+s,y+23);
|
||||
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 barWidth = bat*(s-12)/100;
|
||||
var color = bat < 15 ? "#f00" : (bat <= 30 ? "#f80" : "#0f0");
|
||||
|
|
Loading…
Reference in New Issue