From d19ef0f45aea72756b2b1e658fdb1f8321e761cb Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Thu, 4 Jul 2019 13:30:02 +0900 Subject: add new design --- launcher/qml/Launcher.qml | 63 +++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) (limited to 'launcher/qml/Launcher.qml') diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index 4b1971a..9992ac3 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -25,6 +25,7 @@ ApplicationWindow { height: container.height * container.scale property int pid: -1 + property bool isLongPress: false Item { id: container @@ -33,6 +34,11 @@ ApplicationWindow { height: 1920 // scale: screenInfo.scale_factor() + Image { + anchors.fill: parent + source: './images/background.png' + } + Image { id: topshortcutArea x: 197 @@ -45,42 +51,17 @@ ApplicationWindow { } } - Image { - id: meterDisplay + AnimationBar { + id: animationbar x: 0 y: 1704 - width: 270 - height: 215 - source: './images/meterdisplay.png' - } - Image { - id: hud - anchors.left: meterDisplay.right - anchors.top: meterDisplay.top - width: 270 - height: 215 - source: './images/hud.png' - } - Image { - id: rse - anchors.left: hud.right - anchors.top: hud.top - width: 270 - height: 215 - source: './images/rse.png' - } - Image { - id: uninstall - anchors.left: rse.right - anchors.top: rse.top - width: 270 - height: 215 - source: './images/uninstall.png' + state: 'release' } - Image { - anchors.fill: parent - source: './images/background.png' + BottomShortcutArea { + id: bottomshortcutarea + x: 0 + y: 1704 } GridView { @@ -135,6 +116,9 @@ ApplicationWindow { currentId = applicationModel.id(newIndex = index) currentName = applicationModel.name(loc.index) homescreenHandler.hideWindow("homescreen") + animationbar.state = 'press' + animationbar.startAnimationTimer() + isLongPress = true } onReleased: { if (currentId === '' && loc.index >= 0 ) { @@ -151,15 +135,15 @@ ApplicationWindow { applicationModel.move(newIndex, newIndex = oldIndex) } } else if (loc.mouseY >= 1488) { - if (loc.mouseX < 270 ) { + if (loc.mouseX < 295 ) { console.log("sendAppToMeter", currentId) homescreenHandler.sendAppToMeter(currentId) - } else if (loc.mouseX >= 270 && loc.mouseX < 540 ) { + } else if (loc.mouseX >= 295 && loc.mouseX < 590 ) { console.log("sendAppToHud", currentId) homescreenHandler.sendAppToHud(currentId) - } else if (loc.mouseX >= 540 && loc.mouseX < 810 ) { + } else if (loc.mouseX >= 590 && loc.mouseX < 885 ) { - } else if (loc.mouseX >= 810) { + } else if (loc.mouseX >= 885) { uninstallDialog.contents = 'Do you want to uninstall ' + currentName.toUpperCase() + '?' uninstallDialog.uninstallApp = currentId uninstallDialog.visible = true @@ -172,7 +156,12 @@ ApplicationWindow { currentName = '' currentId = '' - homescreenHandler.tapShortcut("homescreen") + if (isLongPress) { + homescreenHandler.tapShortcut("homescreen") + isLongPress = false + animationbar.state = 'release' + animationbar.stopAnimationTimer() + } } onPositionChanged: { if (loc.currentId === '') return -- cgit 1.2.3-korg