Skip to content

Use a set width for speed label in status bar #22511

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xavier2k6
Copy link
Member

Closes #9343.

xRef: #17538 & #12907

@xavier2k6 xavier2k6 added Look and feel Affect UI "Look and feel" only without changing the logic GUI GUI-related issues/changes labels Apr 5, 2025
@xavier2k6 xavier2k6 requested a review from a team April 5, 2025 19:36
@glassez
Copy link
Member

glassez commented Apr 6, 2025

Are you sure it will look good with any translation? (I have come across software many times that had problems with Russian translation due to fixed UI elements.)

@glassez
Copy link
Member

glassez commented Apr 6, 2025

So I would still not set a fixed width, but only increase the minimum one.
And maybe you shouldn't increase it so much?

@glassez
Copy link
Member

glassez commented Apr 6, 2025

A more advanced solution could be to change the minimum width each time the width increases (i.e., only allow it to grow until it reaches the maximum required width).

@xavier2k6
Copy link
Member Author

I don't think the translation is an issue as setFixedWidth is used in other places in code:
https://github.com/search?q=repo%3Aqbittorrent%2FqBittorrent%20setFixedWidth&type=code

I checked setMaximumWidth
https://github.com/search?q=repo%3Aqbittorrent%2FqBittorrent%20setMaximumWidth&type=code

I also checked setMinimumWidth
https://github.com/search?q=repo%3Aqbittorrent%2FqBittorrent%20setMinimumWidth&type=code

The setMinimumWidth in statusbar.cpp was too small & in testing 250 also seemed to cause a problem of jumpiness, however it was significantly reduced....I chose to go with setFixedWidth & 300 as it was used elsewhere in code & it did what was requested in #9343, however - I can change it to setMinimumWidth(275) or reduce the setFixedWidth to 275?? or do you insist on testing/incrementing setMinimumWidth by say 5 to reach the maximum required width, do you then still want to use setMinimumWidth or change to setMaximumWidth / setFixedWidth??

@glassez
Copy link
Member

glassez commented Apr 6, 2025

I don't think the translation is an issue as setFixedWidth is used in other places in code:
https://github.com/search?q=repo%3Aqbittorrent%2FqBittorrent%20setFixedWidth&type=code

Do you believe I dislike setFixedWidth itself? No, but the fact that it is inappropriate in this particular context (unlike those where it is used in the existing code examples you provided).
The problem is that in the case of a variable text length, a fixed field width chosen arbitrarily will either be insufficient to accommodate some text, or redundant large.
(BTW, it would be nice to see some screenshots of how it looks with content of different lengths.)

@xavier2k6
Copy link
Member Author

(BTW, it would be nice to see some screenshots of how it looks with content of different lengths.)

#9343 (comment)

@glassez
Copy link
Member

glassez commented Apr 6, 2025

A more advanced solution could be to change the minimum width each time the width increases (i.e., only allow it to grow until it reaches the maximum required width).

Another solution to the problem is to use speed formatting with reduced width spread, in a similar way as it is done to display the speed in the macOS dock icon.

@stalkerok
Copy link
Contributor

A more advanced solution could be to change the minimum width each time the width increases (i.e., only allow it to grow until it reaches the maximum required width).

IMO, this approach is the best. If necessary, the width will increase to the necessary limit and remain fixed. The initial (minimum) width can be left as it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI GUI-related issues/changes Look and feel Affect UI "Look and feel" only without changing the logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the widths of columns in status bar
3 participants