diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-10-21 20:09:43 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-10-21 20:10:16 (GMT) |
| commit | 9f3c75d5129390ba81d924fe65a9f1d4eb6f3727 (patch) | |
| tree | f2808f2c5f388ed05c05aa78a7d849d6753b264d /wasp | |
| parent | 6cd1e86295359f2c80b479375c6a728adffaea80 (diff) | |
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>
Diffstat (limited to 'wasp')
| -rw-r--r-- | wasp/widgets.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wasp/widgets.py b/wasp/widgets.py index 2e56d4d..58392af 100644 --- a/wasp/widgets.py +++ b/wasp/widgets.py @@ -56,7 +56,7 @@ class BatteryMeter: red = 31-green rgb = (red << 11) + (green << 6) - if (level > 5) ^ (self.level > 5): + if self.level < 0 or ((level > 5) ^ (self.level > 5)): if level > 5: draw.rleblit(icon, pos=(239-icon[0], 0), fg=0x7bef) else: |
