[core/themes] Add state themes

Each widget can now return a state using the method "state()". This
string is then used to look up a theme information which is used instead
of the default or module theme, if found.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-09 13:32:22 +01:00
parent 88b36417f8
commit 4baf63f88c
5 changed files with 50 additions and 13 deletions

View file

@ -28,10 +28,14 @@ class MockOutput(object):
def end(self):
pass
class MockWidget(object):
class MockWidget(Widget):
def __init__(self, text):
self._text = text
self.module = None
self.attr_state = "state-default"
def state(self):
return self.attr_state
def update(self, widgets):
pass