win0err / gnome-runcat

😼 The cat tells you the CPU usage by running speed
https://extensions.gnome.org/extension/2986/runcat/
GNU General Public License v3.0
413 stars 28 forks source link

Maintain consistent widget width #38

Closed Batwam closed 1 year ago

Batwam commented 1 year ago

Hello,

As mentioned on a previously cancelled PR, the widget changes width when the % drops below 10, making the panel icons around it move around. Rather than manually adding some spaces to the label value as I did before, I tried to implement a neater CSS based solution here to set a fixed width, combined with right alignment for the text and some padding to keep the text away from the adjacent icons.

Please have a look and let me know what you think. I'm not really an expert with setting dimensions with the various notations between numbers, em or pixel values but I figures that the em ratio would be the more appropriate to make sure it's proportional to the font size. 2.0em was leading to the width being too short with font scaling >1.1. I tested a width of 2.1em and had no issue even if I tripled the font size.

Btw, I also test with % only or icon only and they also look fine.

before: image image

after: image image

Batwam commented 1 year ago

Closing the PR as it is not being reviewed