diff options
author | 2018-11-30 13:29:39 +0900 | |
---|---|---|
committer | 2018-11-30 13:29:39 +0900 | |
commit | ca5835ae771cc3921433b951f25f5207ac3d6999 (patch) | |
tree | f08157065e593b650d9f8608dca40882a583d0d4 /app/BtnMapDirection.qml | |
parent | 94055f5398b01a58624b3dc91f2f04027ec2a4b5 (diff) |
add aw navigationsandbox/zheng_wenlong/testqt
Diffstat (limited to 'app/BtnMapDirection.qml')
-rw-r--r--[-rwxr-xr-x] | app/BtnMapDirection.qml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/app/BtnMapDirection.qml b/app/BtnMapDirection.qml index ea52d6e..8f6074d 100755..100644 --- 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" }
+ }
]
- }
+ }
}
|