Modification for dynamic speed sign (not activated)
[staging/HomeScreen.git] / HomeScreen / qml / Home.qml
index ba7e1af..6657d40 100644 (file)
@@ -18,6 +18,8 @@
 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 {
@@ -39,8 +41,20 @@ Item {
         anchors.horizontalCenter: parent.horizontalCenter
         anchors.top: parent.top
         anchors.topMargin: 20
-        source: './images/B14-90.png'
+        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
@@ -117,8 +131,17 @@ Item {
         animation2.running = true;
     }
 
-    function showSign90(show) {
+    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) {
@@ -128,6 +151,19 @@ Item {
     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<auts.length; i++) {
+                if(auts[i] !== '')
+                    myModel.append({"name": auts[i]})
+            }
+        }
+    }
 
     GridView {
         anchors.centerIn: parent
@@ -178,6 +214,54 @@ Item {
             }
         }
     }
+    ListModel {
+        id: myModel
+        ListElement {
+            name: 'Install App'
+        }
+        ListElement {
+            name: 'Open Trunk'
+        }
+        ListElement {
+            name: 'Update Software'
+        }
+        ListElement {
+            name: 'View Online'
+        }
+    }
+    Item {
+        id: authorisations
+        anchors.fill: parent
+        visible: false
+        GridLayout {
+            id: gridAut
+            columns: 2
+            anchors.bottom: parent.bottom
+            anchors.left: parent.left
+            anchors.bottomMargin: 50
+            anchors.leftMargin: 20
+            Repeater {
+                model: myModel
+                Image {
+                    source: './images/' + model.name + '.png'
+                    width: sourceSize.width
+                    height: sourceSize.height
+                    visible: true
+                }
+            }
+        }
+        Label {
+            id: labelUserType
+            anchors.bottom: gridAut.top
+            anchors.bottomMargin: 10
+            anchors.left: gridAut.left
+            color: "white"
+            text: "Owner"
+            font.pixelSize: 30
+            font.family: "Roboto"
+        }
+    }
+
     Image {
         id: logout
         width: sourceSize.width