Set default scrolling width to match text length

This change means that a scrollable widgets like 'shell' will by default
appear the same as before the feature was introduced.
This commit is contained in:
es80 2021-03-17 20:03:06 +00:00
parent 65da1e2246
commit ff1622cd1d

View file

@ -74,7 +74,7 @@ def scrollable(func):
widget.set("scrolling.direction", "right")
widget.set("__content__", text)
width = util.format.asint(module.parameter("scrolling.width", 30))
width = util.format.asint(module.parameter("scrolling.width", len(text)))
if util.format.asbool(module.parameter("scrolling.makewide", True)):
widget.set("theme.minwidth", "A" * width)
if width < 0 or len(text) <= width: