Move item delay

pull/16/head
reionwong 5 years ago
parent 689e3c5f70
commit 7c3bf3190e

@ -30,6 +30,7 @@ Item {
property bool searchMode: false
property bool dragStarted: false
property var dragItemIndex: index
property var dragSource: null
property int pageIndex: 0
property int pageCount: 0
@ -59,11 +60,26 @@ Item {
return
if (drag.source) {
launcherModel.move(drag.source.dragItemIndex,
control.dragSource = drag.source
dragTimer.restart()
} else {
control.dragSource = null
dragTimer.stop()
}
}
}
Timer {
id: dragTimer
interval: 300
onTriggered: {
if (control.dragSource) {
launcherModel.move(control.dragSource.dragItemIndex,
control.dragItemIndex,
control.pageIndex,
control.pageCount)
_pageModel.move(drag.source.dragItemIndex, control.dragItemIndex)
_pageModel.move(control.dragSource.dragItemIndex,
control.dragItemIndex)
}
}
}

@ -39,21 +39,6 @@ Item {
property bool showed: launcher.showed
property int iconSize: root.height < 960 ? 96 : 128
onShowedChanged: {
if (showed)
searchFieldAni.start()
}
NumberAnimation {
id: searchFieldAni
from: 0.0
to: 1.0
target: textField
property: "opacity"
easing.type: Easing.InQuad
duration: 250
}
// onShowedChanged: {
// appViewOpacityAni.restart()
// blurAnimation.restart()

Loading…
Cancel
Save