From 984b02fc0ea25d86cca5c1c837b8ac7648add20e Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Fri, 14 Jun 2019 14:32:39 +0900 Subject: add app list --- launcher/qml/Launcher.qml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'launcher/qml/Launcher.qml') diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index 034e05a..4b1971a 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -138,24 +138,13 @@ ApplicationWindow { } onReleased: { if (currentId === '' && loc.index >= 0 ) { - // Not long press, exec application and tapshortcut -// pid = launcher.launch(applicationModel.id(loc.index)) -// if (1 < pid) { homescreenHandler.tapShortcut(applicationModel.appid(loc.index)) - -// } -// else { -// console.warn("app cannot be launched!") -// } } else if (loc.mouseY <= 0) { if (loc.mouseX >= 197 && loc.mouseX < 393) { -// shortcutAppModel.changeShortcut(currentId, currentName, "0"); homescreenHandler.registerShortcut(currentId, currentName, "0"); } else if (loc.mouseX >= 393 && loc.mouseX < 589) { -// shortcutAppModel.changeShortcut(currentId, currentName, "1"); homescreenHandler.registerShortcut(currentId, currentName, "1"); } else if (loc.mouseX >= 589 && loc.mouseX < 785) { -// shortcutAppModel.changeShortcut(currentId, currentName, "2"); homescreenHandler.registerShortcut(currentId, currentName, "2"); } if (oldIndex != newIndex){ @@ -175,6 +164,10 @@ ApplicationWindow { uninstallDialog.uninstallApp = currentId uninstallDialog.visible = true } + if (oldIndex != newIndex){ +// applicationModel.recordAppsPosition(newIndex, oldIndex, 0) + applicationModel.move(newIndex, newIndex = oldIndex) + } } currentName = '' @@ -185,7 +178,8 @@ ApplicationWindow { if (loc.currentId === '') return if (index < 0) return if (index === newIndex) return - applicationModel.move(newIndex, newIndex = index) + applicationModel.move(newIndex, newIndex = index) + applicationModel.recordAppsPosition() } } } -- cgit 1.2.3-korg