summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <[email protected]>2016-10-06 14:20:34 +0900
committerEike Hein <[email protected]>2016-10-06 14:22:38 +0900
commit1e34e1e7aba969a0d4e486ff6845fb1b7bce4522 (patch)
treed594568b6f39521c285aec3eba0d28b880d82152
parent5945063f0be18f680977abf3629120402f39c081 (diff)
Don't set margins by availableScreenRect in widget mode.
As of 89a3e34b in plasma-framework, availableScreenRect is defined on plasmoid even for applets instead of just containments. Therefore we now need to check for isContainment along for the prop (since the rect could still be null before the applet gets a containment).
-rw-r--r--containments/desktop/package/contents/ui/main.qml8
1 files changed, 4 insertions, 4 deletions
diff --git a/containments/desktop/package/contents/ui/main.qml b/containments/desktop/package/contents/ui/main.qml
index e86c45a..e722356 100644
--- a/containments/desktop/package/contents/ui/main.qml
+++ b/containments/desktop/package/contents/ui/main.qml
@@ -77,18 +77,18 @@ DragDrop.DropArea {
onIconHeightChanged: updateGridSize()
anchors {
- leftMargin: plasmoid.availableScreenRect ? plasmoid.availableScreenRect.x : 0
- topMargin: plasmoid.availableScreenRect ? plasmoid.availableScreenRect.y : 0
+ leftMargin: (isContainment && plasmoid.availableScreenRect) ? plasmoid.availableScreenRect.x : 0
+ topMargin: (isContainment && plasmoid.availableScreenRect) ? plasmoid.availableScreenRect.y : 0
// Don't apply the right margin if the folderView is in column mode and not overflowing.
// In this way, the last column remains droppable even if a small part of the icon is behind a panel.
rightMargin: folderViewLayer.ready && (folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowLeftToRight)
- && plasmoid.availableScreenRect && parent
+ && (isContainment && plasmoid.availableScreenRect) && parent
? parent.width - (plasmoid.availableScreenRect.x + plasmoid.availableScreenRect.width) : 0
// Same mechanism as the right margin but applied here to the bottom when the folderView is in row mode.
bottomMargin: folderViewLayer.ready && (folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowTopToBottom)
- && plasmoid.availableScreenRect && parent
+ && (isContainment && plasmoid.availableScreenRect) && parent
? parent.height - (plasmoid.availableScreenRect.y + plasmoid.availableScreenRect.height) : 0
}