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.
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.
(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.
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.
(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.
Created attachment 151079 [details] latte-dock top-left panel
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.
(In reply to Nate Graham from comment #6) OK, thank you very much. Just wanted to make sure.