-
Notifications
You must be signed in to change notification settings - Fork 815
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 the ability to customise scrollbar bar segments #4500
Comments
You can patch in a new scrollbar renderable as follow: from textual.scrollbar import Scrollbar
ScrollBar.renderer = MyScrollbarRenderer Have a look at how the original is implemented. You can copy that and customize it. |
For sure! I was just hoping for an easier way than duplicating the ~72 line render function. Textual is still developing pretty quickly, and I'm wary vendoring too much of its code to fix things. |
@mon For what it's worth, the scrollbar renderer has been in place for well over a year, has been stable as far as I can remember, and is part of the documented API. |
Yeah, that's not going to change. Textual's API is quite stable now. |
That's good to know! I guess then - would a PR changing the bar glyphs to be a classvar be rejected? I still do like the idea of a 3-line way to modify the class. |
I think that would be reasonable. Happy to accept a PR. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Currently, the characters that make up a scrollbar are hardcoded. It would be nice if they could be overridden. Personally, I need to support poor fonts, so need to replace missing glyphs. But it would be neat to use braille characters for a unique style.
Thoughts on making them a classvar, so they can be monkeypatched in for now? I can do that PR if it's an OK change.
The text was updated successfully, but these errors were encountered: