-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add a marquee widget #2917
Description
(This issue is reserved for the EuroPython 2023 sprint. If you are not participating in the sprint, please refrain from working on this issue. Thanks!)
This issue concerns itself with adding a new widget to Textual.
The marquee widget should be similar to HTML marquees (scroll down to the examples in this page to see what the HTML marquee was).
The widget should have a reactive attribute that holds the string or the rich.text.Text instance that should be rotated endlessly.
You'll probably want to take a look at timers / the attribute auto_refresh to enable the marquee animation.
You will want to implement a method render that is responsible for returning the “frames” of your marquee widget.
You may also look at _progress_bar.py::Bar.render and _progress_bar.py::Bar.render_indeterminate for some inspiration on how to implement a cyclical animation.
After you are done with the implementation, consider adding a reactive attribute that controls the speed of the animation.
Take a look at #2333 to see what files need to be changed when you implement a new widget.
Then, don't be like me and also do the final step shown in #2399 to add your new widget to the widget gallery.
Good luck and have fun!