Created attachment 153189 [details] Panel without panel spacers SUMMARY I'm trying to center icon-only task manager on a panel and the logic actually works, but spacers take too much space and icons become shrink. Note: The issue exists primarily on smaller laptop displays, but also on a bigger desktop screens if you open enough applications (e.g. a lot of instances of Konsole). STEPS TO REPRODUCE 1. Add icon-only widget to a panel (if it's not already present) 2. Add the first panel spacer with flexible size before the Application Launcher button 3. Add the second panel spacer with flexible size after the icon-only task manager 4. Exit edit mode OBSERVED RESULT - Icons in icon-only task manager become shrink and panel spacers use all the space on the panel. (see attachment: panel-with-panel-spacers-filexible-size.png). EXPECTED RESULT - Icons in icon-only task manager are with the same size as before the spacers are added. - Panel spacers are wide just enough to center the icons properly without impacting their size, as it's the case when no spacers are present (see attachment: panel-without-panel-spacers.png). SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.26 KDE Plasma Version: 5.26.0 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.6 ADDITIONAL INFORMATION Dragging the spacers around sometimes result with messed-up other widgets in the panel (e.g. the Application Launcher goes after the icon-only task manager instead of the panel.
Created attachment 153190 [details] Panel with panel spacers flexible size
I think this is happening because there's actually not enough room on your panel to fully center the Task Manager, because the ystem Tray widget to the right of takes up too much of the available space. If you remove the System Tray widget, does the Task Manager take up the amount of space you would expect?
Yes, it works on large displays and when the System Tray widget is removed. What is not clear enough to me, is how actually the Panel Spacer works / should work? I mean, does it calculate space to the edges of the screen (ignoring everything in between) or to the beginning of the next widget? For example, if a panel contains the following structure: Panel Spacer <-> Task Manager <-> Panel Spacer <-> System Tray will the Task Manager be centred relative to the screen (i.e. panel's full-width) or to space of the panel not occupied by the System Tray (panel width - system tray width)?
It works the way you're seeing it work. :) If it can center the contents between panel spacers, it will. If it can't, it tries its best while preserving some space (which is what you wanted, or else you wouldn't have added spacers). This is scheduled to become a bit more flexible in Plasma 5.27, but for the most part, what you see is how it's intended and expected to work.
Great explanation :) However, I'm using the spacer from just oposite reason - not to create additional space, but just to center the things on the panel. As a spacer I would like to use it as a "separator", for example to separate task manager from the system tray. And it should affect the size of other widgets only in the situation when there's not enough space. Maybe it's just my assumption how it should work, but let's wait for new options you mentioned in the next release. P.S. It even doesn't work as expected in many other situations, so I've been creating additional bug reports.