Skip to content

Commit

Permalink
fix: drag and drop get null when dragevent not contains special key
Browse files Browse the repository at this point in the history
  • Loading branch information
tsic404 authored and 18202781743 committed Apr 25, 2024
1 parent b2f972b commit c6d2ae0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ ContainmentItem {
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize * 0.8 : Panel.rootObject.dockItemMaxSize

onEntered: function(drag) {
visualModel.items.move((drag.source as AppItem).visualIndex, app.visualIndex)
if (drag.keys.includes("text/x-dde-dock-dnd-appid")) {
visualModel.items.move((drag.source as AppItem).visualIndex, app.visualIndex)
}
}

onDropped: function(drop) {
drop.accept()
taskmanager.Applet.dataModel.moveTo(drop.source.itemId, visualIndex)
if (drop.keys.includes("text/x-dde-dock-dnd-appid")) {
drop.accept()
taskmanager.Applet.dataModel.moveTo(drop.source.itemId, visualIndex)
}
}

property int visualIndex: DelegateModel.itemsIndex
Expand Down

0 comments on commit c6d2ae0

Please sign in to comment.