From ca5835ae771cc3921433b951f25f5207ac3d6999 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Fri, 30 Nov 2018 13:29:39 +0900 Subject: add aw navigation --- app/BtnMapDirection.qml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) mode change 100755 => 100644 app/BtnMapDirection.qml (limited to 'app/BtnMapDirection.qml') diff --git a/app/BtnMapDirection.qml b/app/BtnMapDirection.qml old mode 100755 new mode 100644 index ea52d6e..8f6074d --- a/app/BtnMapDirection.qml +++ b/app/BtnMapDirection.qml @@ -2,18 +2,23 @@ import QtQuick 2.0 import QtQuick.Controls 1.5 Item { - Button { + Button { id: btn_map_direction width: 100 height: 100 function settleState() { - if(btn_map_direction.state == "HeadingUp"){ - btn_map_direction.state = "NorthUp"; + if(root.st_heading_up){ + btn_map_direction.state = "NorthUp" + car_position_mapitem.state = "NorthUp" + root.st_heading_up = false } else { - btn_map_direction.state = "HeadingUp"; + btn_map_direction.state = "HeadingUp" + car_position_mapitem.state = "HeadingUp" + root.st_heading_up = true } - } + map.rotateMapSmooth() + } onClicked: { settleState() } @@ -23,18 +28,18 @@ Item { height: 92 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - source: "images/Direction_Hup.jpeg" + source: "images/202px-Compass-icon_bb_N.svg.png" } states: [ State { name: "HeadingUp" - PropertyChanges { target: image; source: "images/Direction_Hup.jpeg" } + PropertyChanges { target: image; source: "images/240px-Compass_icon_NE.svg.png" } }, State { name: "NorthUp" - PropertyChanges { target: image; source: "images/Direction_Nup.jpeg" } - } + PropertyChanges { target: image; source: "images/202px-Compass-icon_bb_N.svg.png" } + } ] - } + } } -- cgit 1.2.3-korg