summaryrefslogtreecommitdiffstats
path: root/app/BtnArrow.qml
blob: 2039865472f736453eb68f98c48a4e07d0abee86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import QtQuick 2.0
import QtQuick.Controls 1.5

Item {
	Button {
		id: btn_arrow
		width: 100
		height: 100

		function settleState() {
			if(btn_arrow.state == "1"){
				btn_arrow.state = "2";
			} else if(btn_arrow.state == "2"){
				btn_arrow.state = "3";
			} else {
				btn_arrow.state = "1";
			}
		}

		onClicked: { settleState() }

		Image {
			id: image
			width: 92
			height: 92
			anchors.verticalCenter: parent.verticalCenter
			anchors.horizontalCenter: parent.horizontalCenter
			source: "images/SW_Patern_1.bmp"
		}

		states: [
			State {
				name: "1"
				PropertyChanges { target: image; source: "images/SW_Patern_1.bmp" }
			},
			State {
				name: "2"
				PropertyChanges { target: image; source: "images/SW_Patern_2.bmp" }
			},
			State {
				name: "3"
				PropertyChanges { target: image; source: "images/SW_Patern_3.bmp" }
			}
		]

	}
}