Skip to content

applets/taskmanager: choose better badge size on vertical panel

Christoph Wolk requested to merge cwo/plasma-desktop:iotm_badge_size into master

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) badge_default_before badge_default_after
30px panel small spacing badge_30px_small_before badge_30px_small_after
30px panel normal spacing badge_30px_normal_before badge_30px_normal_after
30px panel large spacing badge_30px_large_before badge_30px_large_after

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.

@teams/vdg

Edited by Christoph Wolk

Merge request reports

Loading