applets/taskmanager: choose better badge size on vertical panel
The badge size on the task manager is based on the height of the task manager button; more specifically it is set to have a height of 40 % of the button's height. This generally works very well, but fails in some configurations on vertical panels with IOTM: if the icon spacing is changed, it will affect the height rather than the width of the button (as with a horizontal IOTM), and thus also scale the badge, making the label unreasonably large with large spacing. On a very thin, small spacing panel on the other hand, the label may become unreadably tiny
This change makes the badge size depend on the actual icon size instead. As the icon is always a little smaller than the task manager button, the scaling factor is slightly increased (to 45%) to keep badge size on the default panel the same as it is now.
before | after | |
---|---|---|
default horizontal (should be unchanged) | ![]() |
![]() |
30px panel small spacing | ![]() |
![]() |
30px panel normal spacing | ![]() |
![]() |
30px panel large spacing | ![]() |
![]() |
There's probably still cases where the size is not optimal (I find it a bit tiny on the 30px version, but at least readable in comparison to the before version with small spacing, and not notably huge as they are with large spacing and triple digits will barely fit). Scaling on icon size is conceptually probably the simplest and does feel intuitively correct, and does seem to do a good job in many circumstances.
One major difference is that the badges only grow if the icons grow. Before, each increase in panel size would increase the size of the badge, now it will only do so if the larger panel size leads to a differently-sized icon being used.