Commit 4f4421d4 authored by eekkelund's avatar eekkelund

[AppLauncher] Add animation for removing

parent 796b6de2
...@@ -39,6 +39,7 @@ MouseArea { ...@@ -39,6 +39,7 @@ MouseArea {
property alias slideMoveAnim: slideMoveAnim property alias slideMoveAnim: slideMoveAnim
property QtObject folderModel property QtObject folderModel
property Item folderItem property Item folderItem
property string deleteState: "basic"
id: launcherItem id: launcherItem
parent: parentItem.contentItem parent: parentItem.contentItem
...@@ -89,8 +90,8 @@ MouseArea { ...@@ -89,8 +90,8 @@ MouseArea {
reorderItem = null reorderItem = null
pager.interactive = true pager.interactive = true
parentItem.onUninstall = false parentItem.onUninstall = false
deleter.remove.text = qsTr("Remove") deleteState="basic"
deleter.uninstall.text = qsTr("Uninstall") deleter.uninstalling(deleteState)
folderIndex = -1 folderIndex = -1
reparent(parentItem.contentItem) reparent(parentItem.contentItem)
z = parent.z z = parent.z
...@@ -117,10 +118,15 @@ MouseArea { ...@@ -117,10 +118,15 @@ MouseArea {
var isdel2 = deleter.childAt(delPos.x, delPos.y+height/4)//hjelp? var isdel2 = deleter.childAt(delPos.x, delPos.y+height/4)//hjelp?
if(!isFolder) { if(!isFolder) {
if (isdel === deleter.remove || isdel2 === deleter.remove) { if (isdel === deleter.remove || isdel2 === deleter.remove) {
deleter.uninstalling("remove", iconCaption.text) deleteState="remove"
deleter.uninstalling(deleteState, iconCaption.text)
} else if (isdel === deleter.uninstall || isdel2 === deleter.uninstall) { } else if (isdel === deleter.uninstall || isdel2 === deleter.uninstall) {
deleter.uninstalling("uninstall", iconCaption.text) deleteState="uninstall"
} else deleter.uninstalling("basic") deleter.uninstalling(deleteState, iconCaption.text)
} else{
deleteState="basic"
deleter.uninstalling(deleteState)
}
} }
//When adding new icon to folder or creating new folder //When adding new icon to folder or creating new folder
var offset = gridViewPos.x - item.x var offset = gridViewPos.x - item.x
...@@ -157,7 +163,7 @@ MouseArea { ...@@ -157,7 +163,7 @@ MouseArea {
//called when icon is released and reordering is true //called when icon is released and reordering is true
if (folderIndex >= 0) { if (folderIndex >= 0) {
if (folderModel.get(folderIndex).type == LauncherModel.Application) { if (folderModel.get(folderIndex).type == LauncherModel.Application) {
var folder = folderModel.createFolder(folderIndex, "folder") var folder = folderModel.createFolder(folderIndex, qsTr("folder"))
if (folder) { if (folder) {
folderModel.moveToFolder(modelData.object, folder) folderModel.moveToFolder(modelData.object, folder)
} }
...@@ -173,7 +179,22 @@ MouseArea { ...@@ -173,7 +179,22 @@ MouseArea {
var parentFolderIndex = folderModel.parentFolder.indexOf(folderModel) var parentFolderIndex = folderModel.parentFolder.indexOf(folderModel)
folderModel.parentFolder.moveToFolder(modelData.object, folderModel.parentFolder, parentFolderIndex+1) folderModel.parentFolder.moveToFolder(modelData.object, folderModel.parentFolder, parentFolderIndex+1)
} }
if(deleteState != "basic"){
//Just placeholder to get visual feedback
enabled=false
deleteAnimation.start()
deleteTimer.start()
}
}
Timer {//Just placeholder to get visual feedback
id:deleteTimer
interval: 5000
onTriggered: {
iconWrapper.opacity=1.0
enabled = true
}
} }
NumberAnimation { id:deleteAnimation; target: iconWrapper; property: "opacity"; to: 0.2; duration: 3000;}//Just placeholder to get visual feedback
Timer { Timer {
id: reorderTimer id: reorderTimer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment