Bug 396404 - Menus can overflow when there are a lot of them and space is limited
Summary: Menus can overflow when there are a lot of them and space is limited
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Menu (show other bugs)
Version: 5.13.2
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-11 11:24 UTC by Rui Zhao
Modified: 2023-05-16 20:55 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Global Menu with KDevelop, Clock and 'Show Desktop' Widgets partially pushed out of Plasma's Tray (94.65 KB, image/png)
2022-02-19 23:14 UTC, Lemuel Simon
Details
Global Menu with Bleachbit, everything is pushed out of the panel. (74.65 KB, image/png)
2022-02-19 23:19 UTC, Lemuel Simon
Details
Lattedock with Global Menu (applet-window-appmenu), automatically resized, all widgets fit in the panel. (96.80 KB, image/png)
2022-02-19 23:30 UTC, Lemuel Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rui Zhao 2018-07-11 11:24:45 UTC
So, the problem is that the menu is too wide when there are lots of menu groups, e.g. in kile, so that some items will move out of the panel (or the sibling plasmoids be crowded out of the panel).

I think the solution could covering two aspects:

1. Move "extra" menu groups to a "more" group (e.g. represented by dots), or allow to scroll, given that the plasmoid reaches its maximun length.
2. Limit the maximun number of items and/or the maximun length of the plasmoid.

I don't know if there is a mechanism to tell the plasmoids that the panel has reached the maximun length, but in either way, a mechamisn which supports to limit (the length of the global menu plasmoid) would be useful.
Comment 1 David Edmundson 2018-07-11 17:33:23 UTC
>I don't know if there is a mechanism to tell the plasmoids that the panel has reached the maximun length,

Kind of

Plasmoids (should) set an implicit size, the panel will resize, then resize the plasmoid. The plasmoid should based contents on the size it is, not the size it wants to be.
Comment 2 Lemuel Simon 2022-02-19 23:14:53 UTC
Created attachment 146953 [details]
Global Menu with KDevelop, Clock and 'Show Desktop' Widgets partially pushed out of Plasma's Tray

A couple years later, it is still a problem as of Plasma 5.24.1. Large or medium sized global menus will push out other widget to the rightmost side of the tray. The attached screenshot is a minor case...
Comment 3 Lemuel Simon 2022-02-19 23:19:44 UTC
Created attachment 146954 [details]
Global Menu with Bleachbit, everything is pushed out of the panel.

However...fire up something like Bleachbit with a LARGE menu, everything to the right of the Global Menu widget is pushed out. System Tray, Pager, Clock, everything. This can be a huge PITA with smaller screens (eg. Small laptops).
Comment 4 Lemuel Simon 2022-02-19 23:30:04 UTC
Created attachment 146955 [details]
Lattedock with Global Menu (applet-window-appmenu), automatically resized, all widgets fit in the panel.

Currently, the workaround is to ditch both the default Global Menu and Plasma's Panel, and replace them with Psifodotos' Latte Dock and Global Menu (applet-window-appmenu) solutions. Whatever he did, made Lattedock and his Global Menu smart enough to resize/limit it's content width, so the other widgets would fit in the panel.
Comment 5 Michail Vourlakos 2022-02-20 16:59:58 UTC
Just for the record if anyone is interested in this.
Latte panels are not using GridLayout approach that Plasma panels already use. Latte panels have a left Grid, centered Grid, right Grid working at the same time always. Because of that I had to give to the user the impression that these three Grids are one single Grid that is working always correctly.

Concerning applets that request to fillWidth/Height for simplicity lets call them applets that request to FillLength Latte extended the Qt approach of handling them. The Latte implementation for this is found at: https://invent.kde.org/plasma/latte-dock/-/blob/master/containment/package/contents/ui/abilities/privates/LayouterPrivate.qml

I didnt like how Qt was handling applets that were requesting to FillLength so Latte approach is a little different:
1. Applets that DONOT request to FillLength, the occupy space first
2. The remaining space is divided to parts based on how many applets request to FillLength (so Latte has a ProposedLengthPerApplet in order for all FillLength applets to give them equal opportunity to occupy space)
3. For each FillLength applet we consider the following:
----if applet has provided minimum length this is provided always
----if applet has provided maximum length that is smaller than the latte proposed one then maximum is used
----if applet has provided preferred length that is smaller than the latte proposed one then preferred is used
----if applet has provided preferred length that is bigger than the latte proposed one then proposed is used
----After the applet occupied space ProposedLength is recalculated for remaining FillLength applets to occupy their space based on [3]