Add parameter to prevent scrollable decorator from fixing the module width

This commit is contained in:
WORD559 2019-10-02 21:30:55 +01:00
parent 00c1209f73
commit c8d5346d81

View file

@ -8,11 +8,14 @@ import uuid
import bumblebee.store
_TrueValues = ["true", "t", "yes", "y", "1"]
def scrollable(func):
def wrapper(module, widget):
text = func(module, widget)
if not text: return text
width = widget.get("theme.width", module.parameter("width", 30))
if module.parameter("scrolling.makewide", "true").lower() in _TrueValues:
widget.set("theme.minwidth", "A"*width)
if len(text) <= width:
return text