From 0bb38d4e1b84a11e8fdfaae2e46b66c101fda40e Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 19 Aug 2012 17:49:36 +0200 Subject: preparing new compass watchlet --- qmapwatchlet/compass-metawatch-digital.qml | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 qmapwatchlet/compass-metawatch-digital.qml (limited to 'qmapwatchlet/compass-metawatch-digital.qml') diff --git a/qmapwatchlet/compass-metawatch-digital.qml b/qmapwatchlet/compass-metawatch-digital.qml new file mode 100644 index 0000000..9268435 --- /dev/null +++ b/qmapwatchlet/compass-metawatch-digital.qml @@ -0,0 +1,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 { + + } +} -- cgit v1.2.3