[core/decorators] reset scrolling if content changes

see #622
This commit is contained in:
tobi-wan-kenobi 2020-05-04 20:11:10 +02:00
parent 49c1465b65
commit 98dd8ca5f7
2 changed files with 14 additions and 0 deletions

View file

@ -27,6 +27,12 @@ def scrollable(func):
text = func(module, widget)
if not text:
return text
if text != widget.get("__content__", text):
widget.set("scrolling.start", 0)
widget.set("scrolling.direction", "right")
widget.set("__content__", text)
width = widget.get(
"theme.width", util.format.asint(module.parameter("width", 30))
)