[core/theme] Fix retrieval of rotating theme values (e.g. battery)
When rotating theme values (e.g. the "charge" icon of the battery module(s)), until now, the code just showed the raw list (because it wasn't aware of the need to rotate).
This commit is contained in:
parent
658fbd2c1c
commit
2756f8fbb3
2 changed files with 7 additions and 0 deletions
|
@ -116,6 +116,12 @@ class Theme(object):
|
|||
|
||||
if not type(value) in (list, dict):
|
||||
value = self.__keywords.get(value, value)
|
||||
|
||||
if isinstance(value, list):
|
||||
key = '__{}-idx__'.format(key)
|
||||
idx = widget.get(key, 0)
|
||||
widget.set(key, (idx + 1) % len(value))
|
||||
value = value[idx]
|
||||
self.__current[key] = value
|
||||
return value
|
||||
|
||||
|
|
|
@ -35,3 +35,4 @@
|
|||
- themes: use colors to improve theme readability
|
||||
- brightness: read from CLI tools
|
||||
- input: use events?
|
||||
- themes: rotating icons (battery!)
|
||||
|
|
Loading…
Reference in a new issue