parent
49c1465b65
commit
98dd8ca5f7
2 changed files with 14 additions and 0 deletions
|
@ -27,6 +27,12 @@ def scrollable(func):
|
||||||
text = func(module, widget)
|
text = func(module, widget)
|
||||||
if not text:
|
if not text:
|
||||||
return 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(
|
width = widget.get(
|
||||||
"theme.width", util.format.asint(module.parameter("width", 30))
|
"theme.width", util.format.asint(module.parameter("width", 30))
|
||||||
)
|
)
|
||||||
|
|
|
@ -62,5 +62,13 @@ class config(unittest.TestCase):
|
||||||
self.assertEqual("bc", self.module.get(self.widget))
|
self.assertEqual("bc", self.module.get(self.widget))
|
||||||
self.assertEqual("cd", self.module.get(self.widget))
|
self.assertEqual("cd", self.module.get(self.widget))
|
||||||
|
|
||||||
|
def test_changed_data(self):
|
||||||
|
self.module.text = "abcd"
|
||||||
|
self.module.set("width", 2)
|
||||||
|
self.assertEqual("ab", self.module.get(self.widget))
|
||||||
|
self.assertEqual("bc", self.module.get(self.widget))
|
||||||
|
self.module.text = "wxyz"
|
||||||
|
self.assertEqual("wx", self.module.get(self.widget))
|
||||||
|
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
Loading…
Reference in a new issue