Panel margin for custom widgets

I am using a custom widget for plasma panel. The widget does not fill the whole height of the panel, there is always a space between widget and panel edge.
Screenshot_20231001_132100-2
I am not proficient with QML, but i do not see any margins or offsets in the widget files.
Is it possible to remove this space, to make widget touch the panel edge, like native panel widgets?

The widget is a fork of diy-bar and some time ago it used to work as expected, so i suppose it was some change in plasma that causes this behavior.
From my search i’ve found a similar issue in a reddit post, which suggests that the change was between Plasma 5.20 and 5.21.1

Example of how it used to work from diy-bar
4

I’ve managed to achieve the desired result by using negative margins.

Layout.topMargin: -5
Layout.bottomMargin: -5

I’ve managed to achieve the desired result by using negative margins.

Nooooooo :stuck_out_tongue:

This will break on any non-breeze theme!

What you’re looking for is:

Plasmoid.constraintHints: PlasmaCore.Types.CanFillArea

This will make your applet ignore the panel margins.

2 Likes

Thank you very much! Negative margins required manual input for different panel sizes and seemed like a hacky workaround overall.
I am very happy that you provided the clean solution. :heart: