Bug 457295 - From flexible spacer to flexible panel length
Summary: From flexible spacer to flexible panel length
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel Spacer widget (show other bugs)
Version: 5.25.3
Platform: Neon Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-30 11:18 UTC by Sadi
Modified: 2022-08-02 16:38 UTC (History)
1 user (show)

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


Attachments
latte-dock top-left panel (16.59 KB, image/jpeg)
2022-08-02 16:33 UTC, Sadi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sadi 2022-07-30 11:18:29 UTC
It would be great if flexible spacer were a little more flexible by fading out completely any space not used (i.e. effectively resizing the panel) when it's positioned at the beginning or end of a panel.
This will enable, for example, a panel/dock including only Application Launcher, Window Title, and Window AppMenu (or Global Menu) widgets to be as long as the first widget icon only when there’s no app window in focus, and as long as it is necessary to display the menu bar when an app window is in focus), as in Latte Dock.
Comment 1 Nate Graham 2022-08-01 17:24:38 UTC
You can already do this by setting the minimum panel size to be smaller then the maximum panel size and then removing the flexible spacer item entirely. Its purpose is really to create extra space between widgets, so there's never a reason to add one at the beginning or end of a panel.
Comment 2 Sadi 2022-08-02 09:46:44 UTC
(In reply to Nate Graham from comment #1)
> You can already do this by setting the minimum panel size to be smaller then
> the maximum panel size and then removing the flexible spacer item entirely.
> Its purpose is really to create extra space between widgets, so there's
> never a reason to add one at the beginning or end of a panel.

Yes, but this gives a static panel length.
As I've tried to explain, in a scenario where you have, for example, a top right panel with system tray, etc., and a top center panel with date and time, and a top left panel with application launcher, window title and global menu, your top left panel will need a flexible length because of the varying space requirements especially for the global menu.
Your suggestion causes the panel to display sometimes a big empty space, and sometimes the menu can't fit in at the right end.
Comment 3 Nate Graham 2022-08-02 13:57:38 UTC
It sounds like the bug here is that Task Manager and Global Menu widgets try to gobble up all available space on a panel because they have built-in space-filling spacers. If we made them stop doing that, this would instantly automatically work like you expect, and you could resize a panel containing them to have a minimum size, but it would expand as needed as the widget got wider.

The blocker there is that we would have to add code to redirect right-clicks and drags on an empty area of the panel that does have a flexible spacer widget on it back to the nearest Task Manager or Global Menu widget.

Feel free to file new bug reports asking for that to happen for each of those widgets.
Comment 4 Sadi 2022-08-02 16:33:02 UTC
(In reply to Nate Graham from comment #3)

Thanks.
So you're saying that this requires some change in the widgets, and not the plasma panel, but I just want to confirm this, because those widgets already behave like that in latte-dock, which made me think in the first place that this is panel related.
I'm adding an attachment showing a latte-dock top-left panel containing Application Launcher, Window Title, and Window AppMenu widgets, which only displays the first one when there's no window in focus, and the other two with varying length up to a set maximum point otherwise.
Comment 5 Sadi 2022-08-02 16:33:41 UTC
Created attachment 151079 [details]
latte-dock top-left panel
Comment 6 Nate Graham 2022-08-02 16:36:28 UTC
Latte Dock is probably working around this behavior in those widgets. The correct fix is to fix the widgets themselves to use the existing tools we already have (flexible spacers) rather than re-implementing their functionality internally, which causes bugs like this and ends us up in situations where we have panel code working around widget behavior.
Comment 7 Sadi 2022-08-02 16:38:27 UTC
(In reply to Nate Graham from comment #6)

OK, thank you very much. Just wanted to make sure.