[core/theme] Add a way to exclude themeing for widget

Allow a widget to set "theme.exclude" to extend any part of a theme
(e.g. the suffix). Note that this can later, on demand, be extended to
allow a list of elements to be passed in.

see #401
This commit is contained in:
Tobias Witek 2019-06-27 20:21:53 +02:00
parent 138bd01b76
commit 53462d1f0b

View file

@ -223,6 +223,9 @@ class Theme(object):
if not self._widget: if not self._widget:
self._widget = widget self._widget = widget
if self._widget.get("theme.exclude", "") == name:
return None
if self._widget != widget: if self._widget != widget:
self._prevbg = self.bg(self._widget) self._prevbg = self.bg(self._widget)
self._widget = widget self._widget = widget