X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fqml%2FHome.qml;h=6657d4064f3df4d57d574df9f97e79ed5ef1380a;hb=7f94f08691efc1ce0e98e72707c3f2022d29fa57;hp=301fdbd6a6bdde6c6f20d0b2bbdbd830b4647302;hpb=57e18aeaf2a9ae292af7559580f8154527fc04f5;p=staging%2FHomeScreen.git diff --git a/HomeScreen/qml/Home.qml b/HomeScreen/qml/Home.qml index 301fdbd..6657d40 100644 --- a/HomeScreen/qml/Home.qml +++ b/HomeScreen/qml/Home.qml @@ -18,10 +18,15 @@ import QtQuick 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.0 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 import Home 1.0 Item { id: root + property int pid: -1 + signal languageChanged + signal disconnect Image { anchors.fill: parent @@ -29,8 +34,136 @@ Item { anchors.bottomMargin: -215 source: './images/AGL_HMI_Background_Car-01.png' } + Image { + id: sign90 + width: 200 + height: 200 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 20 + source: './images/sign.png' + visible: false + Label { + id: speedLimit + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Text.AlignHCenter + color: "black" + text: "50" + font.pixelSize: 90 + font.family: "Roboto" + font.bold: true + visible: false + } + } + Image { + id: flagLanguage + scale: 0.7 + anchors.left: parent.left + anchors.leftMargin: 20 + anchors.top: parent.top + anchors.topMargin: 10 + source: './images/us_flag.png' + visible: true + } + Image { + id: visa + width: 200 + height: 124 + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.top: parent.top + anchors.topMargin: 20 + source: './images/visa.png' + visible: false + Label { + id: cardNumber + anchors.top: parent.bottom + anchors.topMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + color: "white" + text: "111" + font.pixelSize: 20 + font.family: "Roboto" + } + } + Item { + id: hello + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 40 + visible: true + Text { + id: helloText + anchors.centerIn: parent + color: 'white' + text: 'No Authenticated User' + font.pixelSize: 40 + font.family: 'Roboto' + SequentialAnimation on font.letterSpacing { + id: animation1 + loops: 1; + NumberAnimation { from: 0; to: 50; easing.type: Easing.InQuad; duration: 3000 } + running: false + onRunningChanged: { + if(running) { + hello.visible = true + } else { + helloText.opacity = 1 + helloText.font.letterSpacing = 0 + } + } + } - property int pid: -1 + SequentialAnimation on opacity { + id: animation2 + loops: 1; + running: false + NumberAnimation { from: 1; to: 0; duration: 2600 } + PauseAnimation { duration: 400 } + } + } + } + function showHello(helloString) { + helloText.text = helloString + animation1.running = true; + animation2.running = true; + } + + function showSign90(show, speed, unit) { + sign90.visible = show + if(show) { + if(speed.length > 2) + speedLimit.font.pixelSize = 60 + else + speedLimit.font.pixelSize = 90 + speedLimit.text = speed + } + sign90.source = './images/B14-90.png' + speedLimit.visible = false + } + + function showVisa(show, num) { + visa.visible = show + cardNumber.text = num; + } + function changeFlag(flagImage) { + flagLanguage.source = flagImage + } + function setUser(type, auts) { + if(type === '') { + authorisations.visible = false + } else { + authorisations.visible = true + labelUserType.text = type + myModel.clear() + for (var i=0; i