diff --git a/containments/taskpanel/package/contents/ui/main.qml b/containments/taskpanel/package/contents/ui/main.qml index 281de739..053b91f1 100644 --- a/containments/taskpanel/package/contents/ui/main.qml +++ b/containments/taskpanel/package/contents/ui/main.qml @@ -249,19 +249,15 @@ PlasmaCore.ColorScope { } } - function resetOffsets() { + Window.onWindowChanged: { if (!Window.window) return; - if (state === "landscape") { + Window.window.offset = Qt.binding(() => { // FIXME: find a more precise way to determine the top panel height - Window.window.offset = PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing - } else { - Window.window.offset = 0 - } + return plasmoid.formFactor === PlasmaCore.Types.Vertical ? PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing : 0 + }); } - Window.onWindowChanged: resetOffsets() - onStateChanged: resetOffsets() states: [ State {