1
0
Fork 0
Commit Graph

5 Commits (jebbatime)

Author SHA1 Message Date
Daniel Thompson ad9714b0dc manager: Recategorize the theme labels for apps
By default bright and mid are white/grey tones, the ui widgets are
blue and the spot colours are different variants of orange.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31 19:22:54 +00:00
Daniel Thompson 1eada36ff4 wasp: manager: Byte-swap the theme encoding
Currently the theme is explicitly little endian. This does match the
underlying hardware but makes it needlessly difficult to hand edit
themes. Switch the default theme and theming tools over to big endian
form and add comments to the default theme to support hand editing.

We also expand the ASCII characters in the default them with hex codes.
This is the final step needed to make hand edited themes trivial to work
with.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31 10:09:38 +00:00
Daniel Thompson 8824646939 tools: themer: Fix the online help
Correct the indentation and the quoting of the theme strings.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13 16:51:07 +00:00
Daniel Thompson 4468285c34 widgets: BatteryMeter: Fix theme handling
Add the battery frame to the theme so it matches the frame used for
charging and rename accordingly.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13 16:51:07 +00:00
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