add testqt source
[apps/navigation.git] / app / BtnMapDirection.qml
diff --git a/app/BtnMapDirection.qml b/app/BtnMapDirection.qml
new file mode 100755 (executable)
index 0000000..ea52d6e
--- /dev/null
@@ -0,0 +1,40 @@
+import QtQuick 2.0\r
+import QtQuick.Controls 1.5\r
+\r
+Item {\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
+                       } else {\r
+                               btn_map_direction.state = "HeadingUp";\r
+                       }\r
+               }\r
+\r
+               onClicked: { settleState() }\r
+\r
+               Image {\r
+                       id: image\r
+                       width: 92\r
+                       height: 92\r
+                       anchors.verticalCenter: parent.verticalCenter\r
+                       anchors.horizontalCenter: parent.horizontalCenter\r
+                       source: "images/Direction_Hup.jpeg"\r
+               }\r
+\r
+               states: [\r
+                       State {\r
+                               name: "HeadingUp"\r
+                               PropertyChanges { target: image; source: "images/Direction_Hup.jpeg" }\r
+                       },\r
+                       State {\r
+                               name: "NorthUp"\r
+                               PropertyChanges { target: image; source: "images/Direction_Nup.jpeg" }\r
+                       }\r
+               ]\r
+       }\r
+}\r