summaryrefslogtreecommitdiff
path: root/qmapwatchlet/compass-metawatch-digital.qml
blob: 9268435b877927a3f90e8679a8f69bbb23c7d72d (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 1.0
import QtMobility.location 1.2
import com.javispedro.sowatch.metawatch 1.0
import com.javispedro.sowatch.qmap 1.0

MWPage {
	MWTitle {
		anchors.top: parent.top
		anchors.left: parent.left
		anchors.right: parent.right
		text: qsTr("Trip computer")
		icon.source: "trip-icon.png"
	}

	PositionSource {
		id: gps
		active: watch.active
		updateInterval: 2000
	}

	function formatSpeed(speed) {
		if (speed < 10) {
			return speed.toFixed(1);
		} else {
			return speed.toFixed(0);
		}
	}

	Column {
		anchors.verticalCenter: parent.verticalCenter
		MWLabel {
			text: qsTr("Speed")
		}
		MWLabel {
			id: speedLabel
			text: gps.position.speedValid ? formatSpeed(gps.position.speed) : ""
		}

		MWLabel {
			text: qsTr("Altitude")
		}
	}

	Column {

	}
}