diff options
author | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2021-08-02 13:20:06 +0000 |
---|---|---|
committer | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2021-08-02 13:20:57 +0000 |
commit | 4c9b4d61b97b60ce1ec24a4db203199ae54936d8 (patch) | |
tree | 85758532d23a310cd117297c6144905e9adce5c5 /BtnMapDirection.qml |
Initial commit for mominavi
mominavi is a example navigation app based on Qt example.
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'BtnMapDirection.qml')
-rw-r--r-- | BtnMapDirection.qml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/BtnMapDirection.qml b/BtnMapDirection.qml new file mode 100644 index 0000000..8858e8a --- /dev/null +++ b/BtnMapDirection.qml @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-3.0+ +// Copyright (C) 2021 AISIN CORPORATION + +import QtQuick 2.0 +import QtQuick.Controls 1.5 + +Item { + Image { + id: image + x: 0 + y: 3 + width: 92 + height: 92 + opacity: 1 + source: "images/02_NORTH-UP.png" + } + + Button { + id: btn_map_direction + width: 100 + height: 100 + iconSource: "" + opacity: 0 + visible: true + clip: false + state: "NorthUp" + + + + function settleState() { + 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" + car_position_mapitem.state = "HeadingUp" + root.st_heading_up = true + } + map.rotateMapSmooth() + } + + onClicked: { settleState() } + + states: [ + State { + name: "HeadingUp" + PropertyChanges { target: image; source: "images/01_HEADING-UP.png" } + }, + State { + name: "NorthUp" + PropertyChanges { target: image; source: "images/02_NORTH-UP.png" } + } + ] + } + +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ |