diff --git a/bumblebee/output.py b/bumblebee/output.py index ee11037..992eec6 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -47,6 +47,11 @@ class Widget(bumblebee.store.Store): self.module = module.name self._module = module + def cls(self): + if not self._module: + return None + return self._module.__module__.replace("bumblebee.modules.", "") + def state(self): """Return the widget's state""" if self._module and hasattr(self._module, "state"): diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 0b2a724..eed2ea7 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -130,6 +130,7 @@ class Theme(object): self._cycle = self._cycles[self._cycle_idx] module_theme = self._theme.get(widget.module, {}) + class_theme = self._theme.get(widget.cls(), {}) state_themes = [] # avoid infinite recursion @@ -141,6 +142,7 @@ class Theme(object): value = self._defaults.get(name, default) value = widget.get("theme.{}".format(name), value) value = self._cycle.get(name, value) + value = class_theme.get(name, value) value = module_theme.get(name, value) for theme in state_themes: