diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-25 18:36:36 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-25 18:43:23 +0100 |
commit | 1e8da2a350ed25ce6cddfc93e287e5bafa633f0f (patch) | |
tree | d5fa205b38fb9e51197799b2d979f4581fd75738 /components/package/contents/ui/MailListView.qml | |
parent | a06a26736fe80d535082a4894da676015a5b0ffe (diff) | |
download | kube-1e8da2a350ed25ce6cddfc93e287e5bafa633f0f.tar.gz kube-1e8da2a350ed25ce6cddfc93e287e5bafa633f0f.zip |
Implement move to folder per D&D
We have to trigger the drop explicitly in onReleased.
Interestingly if we use "Drag.dragType: Drag.Automatic" then we don't
need to explicitly call drop() and the drag and drop behaviour works as
expected, but we end up no longer dragging the actual item from the
listview, which is what we wanted to do (although we'll have to deal
with the item reappering in the list only to then vanish from the actual
move).
It seems Drag.Automatic triggers a new style of drag that is now
recommended but entirely undocumented, and we're doing some old-style/
backwardscompatible drag...
Diffstat (limited to 'components/package/contents/ui/MailListView.qml')
-rw-r--r-- | components/package/contents/ui/MailListView.qml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index 63d285e8..a26dcc2b 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml | |||
@@ -141,6 +141,8 @@ Item { | |||
141 | Item { | 141 | Item { |
142 | id: delegateRoot | 142 | id: delegateRoot |
143 | 143 | ||
144 | property variant mail : model.domainObject | ||
145 | |||
144 | width: scrollbar.visible ? listView.width - scrollbar.width : listView.width | 146 | width: scrollbar.visible ? listView.width - scrollbar.width : listView.width |
145 | height: Kirigami.Units.gridUnit * 5 | 147 | height: Kirigami.Units.gridUnit * 5 |
146 | 148 | ||
@@ -185,6 +187,7 @@ Item { | |||
185 | Drag.active: mouseArea.drag.active | 187 | Drag.active: mouseArea.drag.active |
186 | Drag.hotSpot.x: mouseArea.mouseX | 188 | Drag.hotSpot.x: mouseArea.mouseX |
187 | Drag.hotSpot.y: mouseArea.mouseY | 189 | Drag.hotSpot.y: mouseArea.mouseY |
190 | Drag.source: delegateRoot | ||
188 | 191 | ||
189 | MouseArea { | 192 | MouseArea { |
190 | id: mouseArea | 193 | id: mouseArea |
@@ -197,6 +200,7 @@ Item { | |||
197 | onClicked: { | 200 | onClicked: { |
198 | listView.currentIndex = index | 201 | listView.currentIndex = index |
199 | } | 202 | } |
203 | onReleased: parent.Drag.drop() | ||
200 | } | 204 | } |
201 | 205 | ||
202 | Rectangle { | 206 | Rectangle { |