diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-05-24 13:20:20 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-05-24 13:20:20 (GMT) |
| commit | 4c7e92d9640287f79c80ca3a9a296184fceeeeff (patch) | |
| tree | e5b1f666455097f197805e00ce6ec78861414a81 /wasp | |
| parent | de647b324cd5731eed54fe38e3efe93b26a8be42 (diff) | |
apps: settings: Adopt the slider... it looks more interesting
Diffstat (limited to 'wasp')
| -rw-r--r-- | wasp/apps/settings.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/wasp/apps/settings.py b/wasp/apps/settings.py index 6a268a9..eb6183f 100644 --- a/wasp/apps/settings.py +++ b/wasp/apps/settings.py @@ -12,22 +12,22 @@ class SettingsApp(): NAME = 'Settings' ICON = icons.settings + def __init__(self): + self._slider = wasp.widgets.Slider(3, 10, 90) + def foreground(self): self._draw() wasp.system.request_event(wasp.EventMask.TOUCH) def touch(self, event): - brightness = wasp.system.brightness + 1 - if brightness > 3: - brightness = 1 - wasp.system.brightness = brightness + self._slider.touch(event) + wasp.system.brightness = self._slider.value + 1 self._update() def _draw(self): """Redraw the display from scratch.""" wasp.watch.drawable.fill() - wasp.watch.drawable.string('Settings', 0, 6, width=240) - wasp.watch.drawable.string('Brightness', 0, 120 - 3 - 24, width=240) + wasp.watch.drawable.string('Brightness', 0, 6, width=240) self._update() def _update(self): @@ -37,4 +37,5 @@ class SettingsApp(): say = "Mid" else: say = "Low" - wasp.watch.drawable.string(say, 0, 120 + 3, width=240) + wasp.watch.drawable.string(say, 0, 150, width=240) + self._slider.update() |
