Skip to content

Commit

Permalink
fix: not able to rearrange item in fullscreen mode
Browse files Browse the repository at this point in the history
修复全屏模式无法拖放图标的问题,由 2182128 引入。

Log:
  • Loading branch information
BLumia committed Jul 18, 2024
1 parent fc5af58 commit 3290660
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ import org.deepin.launchpad.models 1.0
InputEventItem {
anchors.fill: parent
objectName: "FullscreenFrame-InputEventItem"

// ----------- Drag and Drop related functions START -----------
Label {
property string currentlyDraggedId

signal dragEnded()

id: dndItem
visible: DebugHelper.qtDebugEnabled
text: "DnD DEBUG"

Drag.onActiveChanged: {
if (Drag.active) {
text = "Dragging " + currentlyDraggedId
} else {
currentlyDraggedId = ""
dragEnded()
}
}
}

function dropOnItem(dragId, dropId, op) {
dndItem.text = "drag " + dragId + " onto " + dropId + " with " + op
ItemArrangementProxyModel.commitDndOperation(dragId, dropId, op)
}

function dropOnPage(dragId, dropFolderId, pageNumber) {
dndItem.text = "drag " + dragId + " into " + dropFolderId + " at page " + pageNumber
ItemArrangementProxyModel.commitDndOperation(dragId, dropFolderId, ItemArrangementProxyModel.DndJoin, pageNumber)
}
// ----------- Drag and Drop related functions END -----------

Control {
id: baseLayer
visible: true
Expand All @@ -35,37 +67,6 @@ InputEventItem {
property Palette textColor: appTextColor
palette.windowText: ColorSelector.textColor

// ----------- Drag and Drop related functions START -----------
Label {
property string currentlyDraggedId

signal dragEnded()

id: dndItem
visible: DebugHelper.qtDebugEnabled
text: "DnD DEBUG"

Drag.onActiveChanged: {
if (Drag.active) {
text = "Dragging " + currentlyDraggedId
} else {
currentlyDraggedId = ""
dragEnded()
}
}
}

function dropOnItem(dragId, dropId, op) {
dndItem.text = "drag " + dragId + " onto " + dropId + " with " + op
ItemArrangementProxyModel.commitDndOperation(dragId, dropId, op)
}

function dropOnPage(dragId, dropFolderId, pageNumber) {
dndItem.text = "drag " + dragId + " into " + dropFolderId + " at page " + pageNumber
ItemArrangementProxyModel.commitDndOperation(dragId, dropFolderId, ItemArrangementProxyModel.DndJoin, pageNumber)
}
// ----------- Drag and Drop related functions END -----------

function tryToRemoveEmptyPage() {
ItemArrangementProxyModel.removeEmptyPage()
}
Expand Down

0 comments on commit 3290660

Please sign in to comment.