[core] Use class theme, if no specific module theme matches
For modules that use aliases, until now, *only* the alias theme was considered. This is typically a bad idea (tm), as the "generic" case is that of a module theme (e.g. "disk", not that of a theme per instance of the module (i.e. "home", "root", etc.)). Therefore, introduce the concept of a "class" theme that can be optionall overridden by a specific module theme. As a pleasant side-effect, this should bring back the disk icons for all instances of the disk module :) fixes #79
This commit is contained in:
parent
86dad7436e
commit
fdcc908d83
2 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue