Skip to content

Pad strings in status bar to prevent reformatting#188

Merged
Rigellute merged 1 commit into
Rigellute:masterfrom
jacobchrismarsh:padded_status_line
Dec 23, 2019
Merged

Pad strings in status bar to prevent reformatting#188
Rigellute merged 1 commit into
Rigellute:masterfrom
jacobchrismarsh:padded_status_line

Conversation

@jacobchrismarsh
Copy link
Copy Markdown
Contributor

Currently there are different-length strings for parameters, such as
On and Off. When you switch options, the bottom status bar
reformats. This is a worse user experience, so this diff pads the bottom
status line so that it never reformats.

The included gifs show the end result.

Old

old_spt

New

improved_spt

Currently there are different-length strings for parameters, such as
`On` and `Off`. When you switch options, the bottom status bar
reformats. This is a worse user experience, so this diff pads the bottom
status line so that it never reformats.

The included videos show the end result.
@LennyPenny
Copy link
Copy Markdown
Contributor

LennyPenny commented Dec 10, 2019

Would it be possible to still make the items centered? It seems odd that they are not centered when the shorter Off is displayed instead of Track
This would require some adaptive padding, or smth like a \t

Copy link
Copy Markdown
Owner

@Rigellute Rigellute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! Thank you for the contribution @jacobchrismarsh

@LennyPenny Feel free to look into centering the text

Comment thread src/ui/mod.rs

let title = format!(
"{} ({} | Shuffle: {} | Repeat: {} | Volume: {}%)",
"{:-7} ({} | Shuffle: {:-3} | Repeat: {:-5} | Volume: {:-2}%)",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice!

@Rigellute Rigellute merged commit f559534 into Rigellute:master Dec 23, 2019
@Rigellute
Copy link
Copy Markdown
Owner

@all-contributors please add @jacobchrismarsh for code

@allcontributors
Copy link
Copy Markdown
Contributor

@Rigellute

I've put up a pull request to add @jacobchrismarsh! 🎉

nighi pushed a commit to nighi/spotify-tui that referenced this pull request Jul 11, 2025
Pad strings in status bar to prevent reformatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants