Skip to content

Implement optional floating panel for Plasma Themes

Niccolò Venerandi requested to merge work/niccolove/floatingpanel into master

This implements a way to make plasma panels floating upon Plasma Theme request.


The API to ask for a floating panel is by adding a floating-center element in the panel svg, and then floating-hint-*-margin elements the size of the margin between the panel and the screen.

The margins are applied to the elements in the panels view. The window of the panel is then resized appropriately in panelview.cpp to be thicker by the desired margin.

Fitts law is preserved; clicking on any empty space between the panel and the screen near it will redirect input inside the panel.

When a window is maximized, the panel de-floats by filling the available space with the svg and moving the content down by relevant margin / 2 so that it's centered.


Known (unfixable?) visual issues: shadows are not supported for floating panels, open applets extend over panel ends (Screenshot_20211124_120412)/Screenshot_20211124_120446.png)). This will be addressed when floating dialogs are implemented later on too.

Known issue: in Wayland, the floating panel preserves a weird shadow around it. It looks really bad. However I'm fairly confident it's Kwin's fault and I'll need help from a kwin dev to fix that in a separate MR.

This adds an option to toggle this on manually: image

Related MRs: plasma-workspace!1215 (merged) and frameworks/plasma-framework!493

Edited by Niccolò Venerandi

Merge request reports