[contrib/progress] allow hiding of inactive state
Add a new "hide-able" state "mayhide" that can be utilized by modules without warning state. This state indicates that the module *may* be hidden by autohide, if the user configures it like this. see #835
This commit is contained in:
parent
f0ab3ef03a
commit
cbd989309d
2 changed files with 2 additions and 2 deletions
|
@ -229,7 +229,7 @@ class i3(object):
|
||||||
for widget in module.widgets():
|
for widget in module.widgets():
|
||||||
if widget.module and self.__config.autohide(widget.module.name):
|
if widget.module and self.__config.autohide(widget.module.name):
|
||||||
if not any(
|
if not any(
|
||||||
state in widget.state() for state in ["warning", "critical"]
|
state in widget.state() for state in ["warning", "critical", "mayhide"]
|
||||||
):
|
):
|
||||||
continue
|
continue
|
||||||
if module.hidden():
|
if module.hidden():
|
||||||
|
|
|
@ -102,7 +102,7 @@ class Module(core.module.Module):
|
||||||
def state(self, widget):
|
def state(self, widget):
|
||||||
if self.__active:
|
if self.__active:
|
||||||
return "copying"
|
return "copying"
|
||||||
return "pending"
|
return ["pending", "mayhide"]
|
||||||
|
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
Loading…
Reference in a new issue