1
0
Fork 0

widminbat - Fix clearing outside of widget bar

master
Martin Boonk 2023-05-12 11:15:51 +02:00
parent 9dd40c9d64
commit 69527428c5
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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",

View File

@ -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");