Drop item add delay
This commit is contained in:
parent
668e365b43
commit
27ffb0f7a0
1 changed files with 20 additions and 4 deletions
|
@ -26,6 +26,7 @@ DockItem {
|
||||||
id: appItem
|
id: appItem
|
||||||
|
|
||||||
property var windowCount: model.windowCount
|
property var windowCount: model.windowCount
|
||||||
|
property var dragSource: null
|
||||||
|
|
||||||
iconName: model.iconName ? model.iconName : "application-x-desktop"
|
iconName: model.iconName ? model.iconName : "application-x-desktop"
|
||||||
isActive: model.isActive
|
isActive: model.isActive
|
||||||
|
@ -61,10 +62,13 @@ DockItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
dropArea.onEntered: {
|
dropArea.onEntered: {
|
||||||
if (drag.source)
|
appItem.dragSource = drag.source
|
||||||
appModel.move(drag.source.dragItemIndex, appItem.dragItemIndex)
|
dropTimer.restart()
|
||||||
else
|
}
|
||||||
appModel.raiseWindow(model.appId)
|
|
||||||
|
dropArea.onExited: {
|
||||||
|
appItem.dragSource = null
|
||||||
|
dropTimer.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
dropArea.onDropped: {
|
dropArea.onDropped: {
|
||||||
|
@ -72,6 +76,18 @@ DockItem {
|
||||||
updateGeometry()
|
updateGeometry()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: dropTimer
|
||||||
|
interval: 300
|
||||||
|
onTriggered: {
|
||||||
|
if (appItem.dragSource)
|
||||||
|
appModel.move(appItem.dragSource.dragItemIndex,
|
||||||
|
appItem.dragItemIndex)
|
||||||
|
else
|
||||||
|
appModel.raiseWindow(model.appId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FishUI.DesktopMenu {
|
FishUI.DesktopMenu {
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue