Is there any way to test whether my plasmoid is running in the Status and Notifications panel, rather than a standalone widget in the panel?
Alternatively, can I query the maximum width/height that is available for my Plasmoid CompactRepresentation? I need to make sure my content can’t overflow into other widgets…
In Plasma5 I could test the parent properties , but that just comes up as NULL now.
Alternatively, can I query the maximum width/height that is available for my Plasmoid CompactRepresentation? I need to make sure my content can’t overflow into other widgets…
Looks like those still work. At least I see them as properties of main.parent where main is the PlasmoidItem.
PlasmoidItem {
id: main
...
Component.onCompleted: console.log(main.parent.height) // or just parent.height since this is a direct child.
}
The wunderground code is almost identical to mine, but it doesn’t work on plasma6 - it throws the following error: TypeError: Cannot read property 'pluginName' of undefined
And console.log(main.parent.height) and console.log(parent.height)
both throw the following error. TypeError: Cannot read property 'height' of null
Looks like you can’t query the parent at all in Plasma 6…
The parent property is gone from the plasmoid (Applet) context property; however, there are the containment.containmentType and formFactor properties.
Debugging some, if formFactor is 2, which means it is vertically constrained, (which happens when a plasmoid is in the system tray) and the containmentType is 129, which means the plasmoid is custom embedded in a containment, then the widget is in the system tray.
I have tried this out in my Wunderground widget and it seems to work.