1
0
Fork 0
wasp-os/wasp/apps
kozova1 2624a6e998 Added basic theming engine.
This theming engine uses a bytestring (but supports anything indexable,
as long as the index results are a byte long),
stored as `wasp.system._theme`.
It has a default value, which should not change anything about the way this looks currently.

The theme can be set via `wasp.system.set_theme`,
but this should *ONLY* be used in `main.py`.
`wasp.system.set_theme` will return True if it was successful,
or False if the theme is of an old format.
Using an old format theme will *not* crash the watch,
but will use the default theme instead.

To theme this, one has to use tools/themer.py (use flag -h for complete explanation)
to generate a bytestring that's added in main.py (see diff).

The bytestring is then loaded into 'wasp.system._theme'.
Theme values can be looked up by apps by using `wasp.system.theme("theme-key")`.
Theme keys appear in the function body of `wasp.system.theme()`.

I've took the liberty of converting existing apps to use this method,
and it seems to work well.

A test theme is provided in `tools/test_theme.py`

Signed-off-by: kozova1 <mug66kk@gmail.com>
2020-12-13 16:51:07 +00:00
..
alarm.py apps: alarm: Fix touch handling when the alarm is ringing 2020-11-29 19:14:31 +00:00
clock.py Added basic theming engine. 2020-12-13 16:51:07 +00:00
demo.py apps: demo: Move the logo into the demo app 2020-05-17 14:37:44 +01:00
fibonacci_clock.py docs: Add an Application Library chapter 2020-11-08 14:28:38 +00:00
flashlight.py README: Add a (fairly) comprehensive screenshot tour 2020-08-16 18:48:15 +01:00
gameoflife.py docs: Add an Application Library chapter 2020-11-08 14:28:38 +00:00
haiku.py apps: haiku: Add a simple Haiku viewer 2020-10-10 12:12:59 +01:00
heart.py README: Add a (fairly) comprehensive screenshot tour 2020-08-16 18:48:15 +01:00
hello.py docs: Introduce the Application Writer's Guide. 2020-05-11 21:44:30 +01:00
launcher.py README: Add a (fairly) comprehensive screenshot tour 2020-08-16 18:48:15 +01:00
musicplayer.py apps: music: Add to application index 2020-11-22 09:22:50 +00:00
pager.py apps: pager: notifications: improve swipe handling 2020-11-29 09:12:14 +00:00
settings.py apps: settings: Add Scroll Indicator 2020-12-05 20:51:27 +00:00
snake.py apps: snake: Remove redundant import 2020-12-12 18:15:33 +00:00
steps.py apps: steps: Use the alarm system to reset the step counter at midnight 2020-11-14 12:25:32 +00:00
stopwatch.py manager: Introduce shared "system bar" 2020-11-04 19:00:37 +00:00
template.py docs: Introduce the Application Writer's Guide. 2020-05-11 21:44:30 +01:00
testapp.py apps: testapp: Automatically report free memory 2020-12-13 16:07:24 +00:00