add aw navigation
[apps/navigation.git] / app / BtnMapDirection.qml
old mode 100755 (executable)
new mode 100644 (file)
index ea52d6e..8f6074d
@@ -2,18 +2,23 @@ import QtQuick 2.0
 import QtQuick.Controls 1.5\r
 \r
 Item {\r
-       Button {\r
+    Button {\r
                id: btn_map_direction\r
                width: 100\r
                height: 100\r
 \r
                function settleState() {\r
-                       if(btn_map_direction.state == "HeadingUp"){\r
-                               btn_map_direction.state = "NorthUp";\r
+            if(root.st_heading_up){\r
+                btn_map_direction.state = "NorthUp"\r
+                car_position_mapitem.state = "NorthUp"\r
+                root.st_heading_up = false\r
                        } else {\r
-                               btn_map_direction.state = "HeadingUp";\r
+                btn_map_direction.state = "HeadingUp"\r
+                car_position_mapitem.state = "HeadingUp"\r
+                root.st_heading_up = true\r
                        }\r
-               }\r
+            map.rotateMapSmooth()\r
+        }\r
 \r
                onClicked: { settleState() }\r
 \r
@@ -23,18 +28,18 @@ Item {
                        height: 92\r
                        anchors.verticalCenter: parent.verticalCenter\r
                        anchors.horizontalCenter: parent.horizontalCenter\r
-                       source: "images/Direction_Hup.jpeg"\r
+            source: "images/202px-Compass-icon_bb_N.svg.png"\r
                }\r
 \r
                states: [\r
                        State {\r
                                name: "HeadingUp"\r
-                               PropertyChanges { target: image; source: "images/Direction_Hup.jpeg" }\r
+                PropertyChanges { target: image; source: "images/240px-Compass_icon_NE.svg.png" }\r
                        },\r
                        State {\r
                                name: "NorthUp"\r
-                               PropertyChanges { target: image; source: "images/Direction_Nup.jpeg" }\r
-                       }\r
+                PropertyChanges { target: image; source: "images/202px-Compass-icon_bb_N.svg.png" }\r
+            }\r
                ]\r
-       }\r
+    }\r
 }\r