diff --git a/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml index a3382f8d5e..f95b63850f 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml @@ -236,12 +236,27 @@ ItemDelegate { */ readonly property bool dragActive: dragHandler.drag.active onDragActiveChanged: { - if (dragActive) + if (dragActive) { Drag.start() - else - Drag.drop() + root.dragStarted() + return + } + Drag.drop() + root.dragFinished() } + /*! + \qmlsignal + This signal is emitted when dragging the StatusDraggableListItem item started. + */ + signal dragStarted() + + /*! + \qmlsignal + This signal is emitted when dragging the StatusDraggableListItem item finished. + */ + signal dragFinished() + states: [ State { when: root.dragActive diff --git a/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml b/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml index 0189e2d3e8..446567711d 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml @@ -74,14 +74,6 @@ ColumnLayout { drag.accept() } - onDropped: function(drop) { - let from = d.indexMoveFrom - let to = d.indexMoveTo - d.indexMoveFrom = -1 - d.indexMoveTo = -1 - root.walletStore.moveAccountFinally(from, to) - } - StatusDraggableListItem { id: draggableDelegate anchors.horizontalCenter: parent.horizontalCenter @@ -102,6 +94,14 @@ ColumnLayout { icon.height: 40 icon.name: model.emoji icon.color: Utils.getColorForId(model.colorId) + + onDragFinished: { + let from = d.indexMoveFrom + let to = d.indexMoveTo + d.indexMoveFrom = -1 + d.indexMoveTo = -1 + root.walletStore.moveAccountFinally(from, to) + } } } }