[core] re-enable minimize of widgets

by default, allow toggling the minimized state of a widget via the
middle mouse and draw a single unicode char instead of the actual
widget, maintaining all states.

fixes #661
This commit is contained in:
Tobias Witek 2020-06-23 15:51:14 +02:00
parent 45d8ed23c9
commit 34dadadf90
6 changed files with 48 additions and 14 deletions

View file

@ -184,12 +184,14 @@ class Module(core.input.Object):
:rtype: bumblebee_status.widget.Widget
"""
def widget(self, name=None):
if not name:
def widget(self, name=None, widget_id=None):
if not name and not widget_id:
return self.widgets()[0]
for w in self.widgets():
if w.name == name:
if name and w.name == name:
return w
if w.id == widget_id:
return w
return None