X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=homescreen%2Fqml%2Fmain.qml;h=10509fd78564da7dab4c20b6277526da66a76793;hb=fabcb8148b8032f4f8d04523e2f24cf8debe477f;hp=1312e871a3c248e32c7f38bbb4fd9f91c27fc1c5;hpb=85392e71f90a0322fdc08359ef1d829cdcf67381;p=apps%2Fhomescreen.git diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml index 1312e87..10509fd 100644 --- a/homescreen/qml/main.qml +++ b/homescreen/qml/main.qml @@ -26,39 +26,152 @@ Window { width: container.width * container.scale height: container.height * container.scale title: 'HomeScreen' + color: "#00000000" Image { id: container anchors.centerIn: parent - width: 1080 - height: 1920 + width: 1920 + height: 720 scale: 1.0 - source: './images/AGL_HMI_Blue_Background_NoCar-01.png' + source: './images/menubar_background.png' ColumnLayout { + id: menuBar anchors.fill: parent spacing: 0 TopArea { id: topArea - Layout.fillWidth: true - Layout.preferredHeight: 218 + anchors.horizontalCenter: parent.horizontalCenter + Layout.preferredHeight: 80 + x: 640 } Item { id: applicationArea Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredHeight: 1920 - 218 - 215 + Layout.preferredHeight: 510 visible: true + MouseArea { + enabled: true + } } - MediaArea { - id: mediaArea - Layout.fillWidth: true + ShortcutArea { + id: shortcutArea + anchors.horizontalCenter: parent.horizontalCenter Layout.fillHeight: true - Layout.preferredHeight: 215 + Layout.preferredHeight: 130 + } + } + states: [ + State { + name: "normal" + PropertyChanges { + target: container + y: 0 + } + PropertyChanges { + target: topArea + y: 0 + } + PropertyChanges { + target: applicationArea + y: 80 + } + PropertyChanges { + target: shortcutArea + y: 590 + } + }, + State { + name: "fullscreen" + PropertyChanges { + target: container + y: -720 + } + PropertyChanges { + target: topArea + y: -80 + } + PropertyChanges { + target: applicationArea + y: -510 + } + PropertyChanges { + target: shortcutArea + y: 720 + } + } + ] + transitions: Transition { + NumberAnimation { + target: topArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + NumberAnimation { + target: applicationArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + NumberAnimation { + target: shortcutArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + } + } + + + + + + Item { + id: switchBtn + width: 110 + height: 110 + anchors.right: parent.right + anchors.top: parent.top + z: 1 + Image { + id: image + width: 55 + height: 55 + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.top: parent.top + anchors.topMargin: 5 + source: './images/normal.png' + } + + MouseArea { + anchors.fill: parent + property string btnState: 'normal' + onClicked: { + if (container.state === 'normal') { + turnToFullscreen() + } else { + turnToNormal() + } } } } + function turnToFullscreen() { + image.source = './images/fullscreen.png' + container.state = 'fullscreen' + container.opacity = 0.0 + touchArea.switchArea(1) + } + function turnToNormal() { + image.source = './images/normal.png' + container.state = 'normal' + container.opacity = 1.0 + touchArea.switchArea(0) + } }