Bug 476383 - Panel spacers center applets in free space, instead of in the middle of the panel
Summary: Panel spacers center applets in free space, instead of in the middle of the p...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel Spacer widget (other bugs)
Version First Reported In: master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression
Depends on:
Blocks:
 
Reported: 2023-10-31 18:23 UTC by Alex Čižinský
Modified: 2023-11-02 17:53 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Comparison between 5.27 and 6 on horizontal panel (969.15 KB, image/png)
2023-10-31 18:23 UTC, Alex Čižinský
Details
Comparison between 5.27 and 6 on vertical panel (668.28 KB, image/png)
2023-10-31 18:26 UTC, Alex Čižinský
Details
The bug on Neon-Unstable (117.75 KB, image/png)
2023-10-31 18:27 UTC, Alex Čižinský
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Čižinský 2023-10-31 18:23:42 UTC
Created attachment 162773 [details]
Comparison between 5.27 and 6 on horizontal panel

SUMMARY
When using panel spacers to center an applet on a panel, the applet will be in the center of the two panel spacers, instead of in the center of the panel, like in Plasma 5.27

STEPS TO REPRODUCE
1.  Put at least two applets on a panel 
2.  Center one of them using panel spacers
3.  Set those spacers to Set Flexible Size

OBSERVED RESULT
The applet is centered in the free space where are the spacers
All spacers have the same length

EXPECTED RESULT
Plasma 5.27 behavior:
  The applet is in the middle of the panel
  Spacers may not have the same length

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 
(available in About System)
KDE Plasma Version: 5.27.80 -> Master - build using kdesrc-build
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0

ADDITIONAL INFORMATION
I think this is regression between 5.27 and 6
 
Added image showing comparison between 5.27 and 6
This happens with any applet being centered, not only Task Manager like in the image

Also tested in Neon Unstable inside a virtual machine, showing the same result
Comment 1 Alex Čižinský 2023-10-31 18:26:09 UTC
Created attachment 162774 [details]
Comparison between 5.27 and 6 on vertical panel
Comment 2 Alex Čižinský 2023-10-31 18:27:44 UTC
Created attachment 162775 [details]
The bug on Neon-Unstable
Comment 3 Nate Graham 2023-11-01 21:03:35 UTC
Can reproduce.
Comment 4 Bug Janitor Service 2023-11-02 17:08:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3465
Comment 5 Nate Graham 2023-11-02 17:52:51 UTC
Git commit 09893ea151923979c25f0b85c0d2bf83f76772f1 by Nate Graham, on behalf of Alex Čižinský.
Committed on 02/11/2023 at 18:52.
Pushed by ngraham into branch 'master'.

Fix applet centering by spacers

Prior to this fix, when using spacers to center an applet in a panel,
the applet would be centered in the available space. However, the
desired behavior is for the applet to be centered in the middle of the
panel, just as it was in Plasma 5.27.

The reason of this bug are the API changes in KF6. Prior to this fix,
the code would try to call nonexistent properties, resulting in the
optimalSize property being NaN.

M  +2    -2    applets/panelspacer/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/09893ea151923979c25f0b85c0d2bf83f76772f1