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

Padding for single digit CPU% to maintain width #34

Closed
wants to merge 4 commits into from
Closed

Padding for single digit CPU% to maintain width #34

wants to merge 4 commits into from

Conversation

Batwam
Copy link

@Batwam Batwam commented Nov 8, 2022

I noticed that my tray icons jump around when the CPU % goes below 10 due to the smaller text. Would it be possible to include some padding to maintain the overal width? I tried to add a couple of spaces and while not perfect and there are probably fancier ways to do something more accurate, it looks close enough.

@win0err
Copy link
Owner

win0err commented Nov 8, 2022

Thanks for the PR, I will check it. Maybe I'll introduce an option to pad string in proferences

@Batwam
Copy link
Author

Batwam commented Nov 9, 2022

no worries, it's nothing fancy but I think that it looks a bit nicer. It's probably going to look different depending on font type/size so it's not intended to be pixel accurate. For clarity, I didn't use standard padding functions like padStart as I had to include double space so the string length for single digits is actually longer. I'm ignoring the case were it would report 100% as I doubt I'll even see it that high.
I'm not sure it's worth the effort of a dedicate option as it's pretty trivial but I'll leave it with you if you feel it deserves the effort ;-)

@Batwam
Copy link
Author

Batwam commented Nov 24, 2022

apologies as I messed a few things up. let me close this...

@Batwam Batwam closed this Nov 24, 2022
@win0err
Copy link
Owner

win0err commented Nov 24, 2022

apologies as I messed a few things up. let me close this...

Don't worry, I've added the feature request to the backlog. I'll implement this

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.

2 participants