Bug 460638

Summary: Spacers do not center items when set to flexible size
Product: [Plasma] plasmashell Reporter: Techognito <kde.whxeb>
Component: Panel Spacer widgetAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: mitrax, nate, niccolo.venerandi, nicolas.fella
Priority: NOR    
Version: 5.26.0   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: with pixel adjustment on the left spacer
with all spacers set to flexible
manually adjusted spacer improved image
all spacers flexible, improved image

Description Techognito 2022-10-18 06:49:46 UTC
SUMMARY
***
I use a laptop that is sometimes docked, the laptop monitor and docked monitor are different pixel sizes.

I would like to set the spacer on the panel to be X% of the monitor width, this way the panels would look better on both monitors.

Set flexible size does not work for this issue, as it would misalign my clock (not sure if I should file that as a bug?).
***
Comment 1 veggero 2022-10-18 10:49:06 UTC
What do you mean with "misalign my clock"?
Comment 2 Techognito 2022-10-18 13:19:28 UTC
Created attachment 152993 [details]
with pixel adjustment on the left spacer

This is with one of the 4 spacers manually set
Comment 3 Techognito 2022-10-18 13:22:17 UTC
Created attachment 152994 [details]
with all spacers set to flexible

This is with all the spacers set to flexible, all spacers are now the same size but since the notification widget is wider than the launcher button, the clock is moved left of the center
Comment 4 Techognito 2022-10-18 13:24:32 UTC
Created attachment 152995 [details]
manually adjusted spacer improved image
Comment 5 Techognito 2022-10-18 13:25:19 UTC
Created attachment 152996 [details]
all spacers flexible, improved image
Comment 6 Techognito 2022-10-18 13:31:08 UTC
I believe the flexible spacers are working as intended by all being the same size, which is why I question if I should report that as a separate bug. 

Being able to set the spacer to use percentage would still be nice for changing between dock and laptop monitor.
Comment 7 Nate Graham 2022-10-18 18:56:33 UTC
Hmm, what do you think, Niccolò?
Comment 8 veggero 2022-10-18 20:13:39 UTC
I'd say it looks like a spacers bug; I will look into it tomorrow and, yeah, I'd suggest filing that as a bug rather than this one or - more easily - simply change the title of this bug.
Comment 9 Techognito 2022-10-19 06:08:53 UTC
Renaming this to a bug, and creating a new request for percentage sized spacers
Comment 10 Bug Janitor Service 2022-10-19 09:52:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2235
Comment 11 Niccolò Venerandi 2022-10-29 14:10:31 UTC
Git commit ac4f8d1a1685082734252f55a7d75c4de5fee38f by Niccolò Venerandi.
Committed on 29/10/2022 at 13:40.
Pushed by niccolove into branch 'master'.

Refactor panel spacer flexible auto-sizing code and implement multiple areas

M  +18   -74   applets/panelspacer/package/contents/ui/main.qml
M  +0    -102  applets/panelspacer/plugin/panelspacer.cpp
M  +0    -31   applets/panelspacer/plugin/panelspacer.h

https://invent.kde.org/plasma/plasma-workspace/commit/ac4f8d1a1685082734252f55a7d75c4de5fee38f