improved desktop UI
[mardrone] / mardrone / gauges / GenericGauge.qml
1
2 import QtQuick 1.0
3
4 Item {
5     id: root
6     property real value : 0
7     property real startAngle:0
8     property real endAngle:300
9     property real maxValue:100
10     property url gaugeBackground:""
11     property url gaugeForeground:""
12     property url gaugeNeedle:"needle1.png"
13     property url bezel:""
14
15     Image {
16         anchors.fill:parent
17         anchors.margins: 8
18         source: gaugeBackground
19     }
20
21     Image {
22         id: needle
23         x: (root.width/2)-(width/2); y:(root.width/2)
24         transformOrigin: Item.Top
25         scale: root.width / 300
26         rotation: startAngle+root.value*0.36
27         smooth: true
28         source: gaugeNeedle
29     }
30     Image {
31         anchors.fill:parent
32         source: gaugeForeground
33     }
34     Image {
35         id:bezelImg
36         anchors.fill:parent
37         source: bezel
38     }
39 }