merge github
[apps/navigation.git] / app / BtnArrow.qml
1 import QtQuick 2.0\r
2 import QtQuick.Controls 1.5\r
3 \r
4 Item {\r
5         Button {\r
6                 id: btn_arrow\r
7                 width: 100\r
8                 height: 100\r
9 \r
10                 function settleState() {\r
11                         if(btn_arrow.state == "1"){\r
12                                 btn_arrow.state = "2";\r
13                         } else if(btn_arrow.state == "2"){\r
14                                 btn_arrow.state = "3";\r
15                         } else {\r
16                                 btn_arrow.state = "1";\r
17                         }\r
18                 }\r
19 \r
20                 onClicked: { settleState() }\r
21 \r
22                 Image {\r
23                         id: image\r
24                         width: 92\r
25                         height: 92\r
26                         anchors.verticalCenter: parent.verticalCenter\r
27                         anchors.horizontalCenter: parent.horizontalCenter\r
28                         source: "images/SW_Patern_1.bmp"\r
29                 }\r
30 \r
31                 states: [\r
32                         State {\r
33                                 name: "1"\r
34                                 PropertyChanges { target: image; source: "images/SW_Patern_1.bmp" }\r
35                         },\r
36                         State {\r
37                                 name: "2"\r
38                                 PropertyChanges { target: image; source: "images/SW_Patern_2.bmp" }\r
39                         },\r
40                         State {\r
41                                 name: "3"\r
42                                 PropertyChanges { target: image; source: "images/SW_Patern_3.bmp" }\r
43                         }\r
44                 ]\r
45 \r
46         }\r
47 }\r