diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-11-04 19:00:37 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-11-04 19:00:37 (GMT) |
| commit | 8e89e381751e79b1bc768886263d02f1b72dfbac (patch) | |
| tree | 53ad3e1231a123cb83b72cea2d18c4b52a3d2c7c /wasp/apps/clock.py | |
| parent | f95f45cda3b4ef2baae1c952521d729fbad00577 (diff) | |
manager: Introduce shared "system bar"
Providing a status bar for all apps to use allows us to reduce allocations
within the applications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps/clock.py')
| -rw-r--r-- | wasp/apps/clock.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/wasp/apps/clock.py b/wasp/apps/clock.py index 5919ebf..106e712 100644 --- a/wasp/apps/clock.py +++ b/wasp/apps/clock.py @@ -31,16 +31,13 @@ class ClockApp(): NAME = 'Clock' ICON = icons.clock - def __init__(self): - self._bar = wasp.widgets.StatusBar() - def foreground(self): """Activate the application. Configure the status bar, redraw the display and request a periodic tick callback every second. """ - self._bar.clock = False + wasp.system.bar.clock = False self._draw(True) wasp.system.request_tick(1000) @@ -82,13 +79,13 @@ class ClockApp(): draw.rleblit(digits.clock_colon, pos=(2*48, 80), fg=0xb5b6) # Redraw the status bar - self._bar.draw() + wasp.system.bar.draw() else: # The update is doubly lazy... we update the status bar and if # the status bus update reports a change in the time of day # then we compare the minute on display to make sure we # only update the main clock once per minute. - now = self._bar.update() + now = wasp.system.bar.update() if not now or self._min == now[4]: # Skip the update return |
