Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a marquee widget #2917

Closed
rodrigogiraoserrao opened this issue Jul 11, 2023 · 8 comments
Closed

Add a marquee widget #2917

rodrigogiraoserrao opened this issue Jul 11, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@rodrigogiraoserrao
Copy link
Contributor

rodrigogiraoserrao commented Jul 11, 2023

(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!

@willmcgugan
Copy link
Collaborator

For reference, here is what a marquee looks like...

Screen.Recording.2023-07-12.at.09.50.26.mov

@tonteg
Copy link

tonteg commented Jul 22, 2023

I'll have a look at this.

@rodrigogiraoserrao
Copy link
Contributor Author

Hey @tonteg, are you still working on this or did you drop it?
If you are working on this, do you have any rough estimate of when you might be ready for a PR?
If you are not working on this, do you mind letting us know?
Thanks!

@tonteg
Copy link

tonteg commented Aug 23, 2023

Hi, I temporarily put this aside, but I'd definitely like to finish it. I'll try to get it ready for a PR in the next two weeks.

@rodrigogiraoserrao
Copy link
Contributor Author

Sure thing, @tonteg . Looking forward to your PR.

@TomJGooding
Copy link
Contributor

marquee

@willmcgugan
Copy link
Collaborator

Closing for now, but if there is a PR somewhere I'd be happy to take a look!

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants