1
0
Fork 0
wasp-os/wasp
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
..
apps Added basic theming engine. 2020-12-13 16:51:07 +00:00
boards apps: testapp: Automatically report free memory 2020-12-13 16:07:24 +00:00
drivers boards: simulator: Improve spi.write() simulation 2020-12-12 12:57:06 +00:00
fonts fonts: Add sans28 (numerals only) 2020-06-11 20:37:03 +01:00
modules wasp: apps: Step counter application 2020-06-09 21:31:55 +01:00
boot.py Add licensing information for all wasp-os files. 2020-03-22 15:40:18 +00:00
draw565.py draw565: Added line drawing function 2020-12-12 18:18:01 +00:00
gadgetbridge.py Notify level in settings app 2020-11-29 20:20:03 +00:00
icons.py apps: pager: notifications: Added remove all notifications dialog 2020-11-29 09:12:03 +00:00
logo.py Add licensing information for all wasp-os files. 2020-03-22 15:40:18 +00:00
main.py Introduction basic notification support 2020-07-19 20:50:33 +01:00
ppg.py ppg: Pull the PPG signal processing into a seperate library 2020-06-25 21:59:32 +01:00
requirements.txt simulator: Introduce fully automatic testint 2020-12-04 20:11:41 +00:00
shell.py Add licensing information for all wasp-os files. 2020-03-22 15:40:18 +00:00
wasp.py Added basic theming engine. 2020-12-13 16:51:07 +00:00
widgets.py Added basic theming engine. 2020-12-13 16:51:07 +00:00