Bug 463814 - Fixed panel spacer size not respected, making it impossible to center task manager
Summary: Fixed panel spacer size not respected, making it impossible to center task ma...
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel Spacer (show other bugs)
Version: master
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-04 01:23 UTC by nathan
Modified: 2023-04-13 14:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A demonstration of the behavior (723.22 KB, video/webm)
2023-01-04 01:23 UTC, nathan
Details
Setup, 04-2023 (47.90 KB, image/png)
2023-04-10 14:27 UTC, nathan
Details
Result, 04-2023 (7.12 KB, image/png)
2023-04-10 14:28 UTC, nathan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nathan 2023-01-04 01:23:46 UTC
Created attachment 155006 [details]
A demonstration of the behavior

SUMMARY
I have set up a horizontally centered panel with:
    - A minimum width less than the width of its contents
    - An Icons Only Task Manager (IOTM) widget in the center with "Fill free space on Panel" option disabled
    - Two spacers, one on each side of the IOTM widget (to provide horizontal padding) set to a fixed size of 10

With this panel setup, the two spacers are different sizes and the IOTM widget is not centered.


STEPS TO REPRODUCE
1. Create an empty centered panel
2. Place an IOTM widget on the panel
3. Set the panel min-width to less than width of the panel contents
4. Set the panel max-width significantly greater than the width of the panel contents
5. Place a panel spacer widget to either side of the IOTM widget
6. Uncheck "Set flexible size" for each of the panel spacers 
7. Set each panel spacer to a size of 10

OBSERVED RESULT
The IOTM widget is not centered; there is a different amount of space to either side.

EXPECTED RESULT
Panel spacers would each create an equivalent amount of space on either side of the IOTM widget.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 6.1.2-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 Nate Graham 2023-01-09 19:32:43 UTC
So the problem with that enormous panel is the extra space on the left? Am I understanding that you want just a Task Manager, with no bits of empty panel poking out at all?
Comment 2 nathan 2023-01-09 23:25:36 UTC
(In reply to Nate Graham from comment #1)
> So the problem with that enormous panel is the extra space on the left? 
Yes; the problem is that the left has empty space, but the right does not have an equal amount. The widget is set such that there is no empty space on either side, so my expectation is that when there is a spacer to each side of the widget, each set to an equal size, the spacers should create an equal amount of space on both sides of the panel, making the widget appear centered. The panel is only enormous for the purpose of demonstration by the way :D

When in edit mode, the spacer on the right overhangs the panel, and when edit mode is exited, the spacers reduce in width and the right spacer appears significantly smaller than the left spacer. 

> Am I understanding that you want just a Task Manager, with no bits of empty panel
> poking out at all?
No, I meant to use the spacers to create padding between the start and end of the widget and the edges of the panel, but the amount of padding to either side was unequal despite the spacers being set to the same size. Fundamentally, I just want the widget to be centered with adequate padding on the left and right.
Comment 3 Nate Graham 2023-04-10 02:47:34 UTC
When I replicate your setup in Plasma 5.27.4, it seems to be working; the spacers on each side are 10px and retain the same size. I have a memory of there being some faulty code in earlier Plasma releases having to do with unnecessary space being allocated to the configure button outside of edit mode; can you try again with Plasma 5.27.4 to see if it's fixed for you now as well>
Comment 4 nathan 2023-04-10 14:27:39 UTC
Created attachment 157993 [details]
Setup, 04-2023
Comment 5 nathan 2023-04-10 14:28:10 UTC
Created attachment 157994 [details]
Result, 04-2023
Comment 6 nathan 2023-04-10 14:30:16 UTC
(In reply to Nate Graham from comment #3)

Thanks, I have tried again and attached the results. I'm not seeing any difference just now, but it may be worth noting that I ran a system upgrade recently and haven't restarted yet as I am running a large sync operation. I'll try again once I restart and will let you know. 

Also, I don't know if this is worth mentioning, but I am using fractional scaling on the desktop.
Comment 7 Nate Graham 2023-04-10 16:35:06 UTC
And you're using Plasma 5.27.4?
Comment 8 nathan 2023-04-10 16:50:39 UTC
(In reply to Nate Graham from comment #7)
> And you're using Plasma 5.27.4?

I am. I'll try again after a restart.
Comment 9 nathan 2023-04-11 17:07:42 UTC
(In reply to nathan from comment #8)
> (In reply to Nate Graham from comment #7)
> > And you're using Plasma 5.27.4?
> 
> I am. I'll try again after a restart.

I have tried again, and it now occurs to me that the padding difference in my recent attachments was likely due to the widget aligning icons to the left when panel width when the width of the widget was less than the width of the panel. 

I tested with multiple icons, and it appears as though the padding is now even on both sides in Plasma 5.27.4.
Comment 10 Nate Graham 2023-04-13 14:50:27 UTC
Great, sounds like this is working properly.