when there's nothing to return, do it ASAP

This commit is contained in:
me 2020-01-31 11:37:42 +02:00
parent 289a40ff72
commit 9d8c1f910e

View file

@ -354,15 +354,17 @@ class WidgetDrawer(object):
list[1] - JSON text for the widget
"""
separator = self._theme.separator(widget)
self.add_separator(widget, separator)
full_text = widget.full_text()
if widget.get_module() and widget.get_module().hidden():
return []
if widget.get_module() and widget.get_module().name in self._config.autohide():
if not any(state in widget.state() for state in ["warning", "critical"]):
return []
separator = self._theme.separator(widget)
self.add_separator(widget, separator)
full_text = widget.full_text()
padding = self._theme.padding(widget)
prefix = self._theme.prefix(widget, padding)