fix issue,call tap_shortcut carelessly
[apps/launcher.git] / launcher / qml / Launcher.qml
index 6caad1e..6d55271 100644 (file)
  * limitations under the License.
  */
 import QtQuick 2.6
-import QtQuick.Window 2.1
 import QtQuick.Layouts 1.1
 import QtQuick.Controls 2.0
 import AppModel 1.0
 
-Window {
-    visible: true
-    flags: Qt.FramelessWindowHint
+ApplicationWindow {
     width: container.width * container.scale
     height: container.height * container.scale
 
@@ -33,7 +30,7 @@ Window {
         id: container
         anchors.centerIn: parent
         width: 1080
-        height: 1487
+        height: 1488
         scale: screenInfo.scale_factor()
 
         Image {
@@ -72,9 +69,13 @@ Window {
             y: 264
             onPressAndHold: currentId = applicationModel.id(newIndex = index)
             onReleased: {
+                if(loc.index < 0) {
+                    return
+                }
                 if (currentId === '') {
                     pid = launcher.launch(applicationModel.id(loc.index))
                     if (1 < pid) {
+                        homescreenHandler.tapShortcut(applicationModel.name(loc.index))
                     }
                     else {
                         console.warn("app cannot be launched!")
@@ -82,7 +83,6 @@ Window {
                 } else {
                     currentId = ''
                 }
-                homescreenHandler.tapShortcut(applicationModel.name(loc.index))
             }
             onPositionChanged: {
                 if (loc.currentId === '') return