summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <[email protected]>2017-03-02 02:38:06 +0900
committerEike Hein <[email protected]>2017-03-02 23:56:17 +0900
commit0accf128d4cd18162e663940bca65b1a47f57314 (patch)
treee56f75798da886f13a8540a0ab8f94844e81a260
parent54309e677bbfd1ad350cfd17500925be52223f33 (diff)
Fix actions overlay position not adjusting when switching view modes at runtime.
Summary: Setting centerIn to undefined when switching modes at runtime doesn't magically move the item back to 0,0. Reviewers: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4875
-rw-r--r--containments/desktop/package/contents/ui/FolderItemDelegate.qml33
1 files changed, 30 insertions, 3 deletions
diff --git a/containments/desktop/package/contents/ui/FolderItemDelegate.qml b/containments/desktop/package/contents/ui/FolderItemDelegate.qml
index fe26a6b..932a8fb 100644
--- a/containments/desktop/package/contents/ui/FolderItemDelegate.qml
+++ b/containments/desktop/package/contents/ui/FolderItemDelegate.qml
@@ -349,9 +349,36 @@ Item {
z: 3
- anchors {
- centerIn: root.useListViewMode ? icon : undefined
- }
+ states: [
+ State { // icon view
+ when: !root.useListViewMode
+
+ AnchorChanges {
+ target: actions
+ anchors.horizontalCenter: undefined
+ anchors.verticalCenter: undefined
+ }
+ PropertyChanges {
+ target: actions
+ x: 0
+ y: 0
+ }
+ },
+ State { // list view
+ when: root.useListViewMode
+
+ AnchorChanges {
+ target: actions
+ anchors.horizontalCenter: icon.horizontalCenter
+ anchors.verticalCenter: icon.verticalCenter
+ }
+ PropertyChanges {
+ target: actions
+ x: undefined
+ y: undefined
+ }
+ }
+ ]
width: implicitWidth
height: implicitHeight