widgets: battery: Fix a redraw bug
Currently if the real battery level is <5% then a redraw from scratch will not draw the outline of the battery. Fix this by adding a special case for negative previous states (-1 charging, -2 redraw). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
6cd1e86295
commit
9f3c75d512
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ class BatteryMeter:
|
||||||
red = 31-green
|
red = 31-green
|
||||||
rgb = (red << 11) + (green << 6)
|
rgb = (red << 11) + (green << 6)
|
||||||
|
|
||||||
if (level > 5) ^ (self.level > 5):
|
if self.level < 0 or ((level > 5) ^ (self.level > 5)):
|
||||||
if level > 5:
|
if level > 5:
|
||||||
draw.rleblit(icon, pos=(239-icon[0], 0), fg=0x7bef)
|
draw.rleblit(icon, pos=(239-icon[0], 0), fg=0x7bef)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue