textual icon indicating copy to clipboard operation
textual copied to clipboard

how to change ProgressBar height?

Open zphj1987 opened this issue 1 year ago • 5 comments

the default ProgressBar height link a line iShot_2024-11-22_16 30 36

how to change it to link this

iShot_2024-11-22_16 30 59

zphj1987 avatar Nov 22 '24 08:11 zphj1987

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Nov 22 '24 08:11 github-actions[bot]

change the

        half_bar_right = "╸"
        half_bar_left = "╺"
        bar = "━"

in .venv\Lib\site-packages\textual\renderables\bar.py

python-and-novella avatar Dec 04 '24 01:12 python-and-novella

@python-and-fiction, thanks for the tip!

It would be neat if those were a configurable attribute of Bar in the constructor. Opens up lots of fun options:

half_bar_right = "| "
half_bar_left = " |"
bar = "|"  

https://github.com/user-attachments/assets/c9a256c5-6fe6-4c9e-be84-6a41d6eb8ca7

ktmeaton avatar Dec 05 '24 23:12 ktmeaton

Per the original request, a thick progress bar:

half_bar_right = " " 
half_bar_left = " "
bar = "█"

image

ktmeaton avatar Dec 05 '24 23:12 ktmeaton

@python-and-fiction thanks for the your tip it work

zphj1987 avatar Dec 11 '24 06:12 zphj1987

Closing as completed by #5963, which recently added ProgressBar.BAR_RENDERABLE to allow customising the bar.

TomJGooding avatar Sep 10 '25 09:09 TomJGooding

I hope I solved your issue!

Consider sponsoring my work to continue to maintain and develop Textual.

  • Will McGugan

github-actions[bot] avatar Sep 10 '25 09:09 github-actions[bot]