Merge remote-tracking branch 'tobi-wan-kenobi/master'
This commit is contained in:
commit
c73a3cfa34
2 changed files with 7 additions and 0 deletions
|
@ -47,6 +47,11 @@ class Widget(bumblebee.store.Store):
|
||||||
self.module = module.name
|
self.module = module.name
|
||||||
self._module = module
|
self._module = module
|
||||||
|
|
||||||
|
def cls(self):
|
||||||
|
if not self._module:
|
||||||
|
return None
|
||||||
|
return self._module.__module__.replace("bumblebee.modules.", "")
|
||||||
|
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the widget's state"""
|
"""Return the widget's state"""
|
||||||
if self._module and hasattr(self._module, "state"):
|
if self._module and hasattr(self._module, "state"):
|
||||||
|
|
|
@ -130,6 +130,7 @@ class Theme(object):
|
||||||
self._cycle = self._cycles[self._cycle_idx]
|
self._cycle = self._cycles[self._cycle_idx]
|
||||||
|
|
||||||
module_theme = self._theme.get(widget.module, {})
|
module_theme = self._theme.get(widget.module, {})
|
||||||
|
class_theme = self._theme.get(widget.cls(), {})
|
||||||
|
|
||||||
state_themes = []
|
state_themes = []
|
||||||
# avoid infinite recursion
|
# avoid infinite recursion
|
||||||
|
@ -141,6 +142,7 @@ class Theme(object):
|
||||||
value = self._defaults.get(name, default)
|
value = self._defaults.get(name, default)
|
||||||
value = widget.get("theme.{}".format(name), value)
|
value = widget.get("theme.{}".format(name), value)
|
||||||
value = self._cycle.get(name, value)
|
value = self._cycle.get(name, value)
|
||||||
|
value = class_theme.get(name, value)
|
||||||
value = module_theme.get(name, value)
|
value = module_theme.get(name, value)
|
||||||
|
|
||||||
for theme in state_themes:
|
for theme in state_themes:
|
||||||
|
|
Loading…
Reference in a new issue