summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@qt.io>2017-02-23 10:13:55 +0200
committerKari Hautamäki <kari.hautamaki@qt.io>2017-02-24 11:12:10 +0000
commitf8837693091580d1076594d240c46b87a958ef29 (patch)
treeb356a542405a1ed779e29883ca0df17e1d3315c7 /tradeshow/iot-sensortag/resources/base/CircularGauge.qml
parent8bf7f77d5c97a58c987e03598312164e009eee98 (diff)
iot-sensortag: Remove transparent image from object temperature
The transparent image is not needed for object temperature cauge. Change-Id: I8880f0ef3c84a382a7bfc9cdaf867e901fbf6219 Reviewed-by: Kari Hautamäki <kari.hautamaki@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/resources/base/CircularGauge.qml')
-rw-r--r--tradeshow/iot-sensortag/resources/base/CircularGauge.qml41
1 files changed, 5 insertions, 36 deletions
diff --git a/tradeshow/iot-sensortag/resources/base/CircularGauge.qml b/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
index a26e9dd..431ee99 100644
--- a/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
+++ b/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
@@ -47,7 +47,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.7
Item {
id: gauge
@@ -61,14 +61,13 @@ Item {
property real prevValue: min
property int currentColorSection
- property int nextColorSection
property var colorSections: ["ObjectTemperature/objTemp_display_obj_blue.png",
"ObjectTemperature/objTemp_display_obj_green.png",
"ObjectTemperature/objTemp_display_obj_orange.png",
"ObjectTemperature/objTemp_display_obj_red.png"]
onValueChanged: {
- currentColorSection = Math.floor((prevValue - min) / (max - min) * 3);
+ currentColorSection = Math.floor((value - min) / (max - min) * 3);
if (currentColorSection < 0)
currentColorSection = 0;
@@ -84,11 +83,6 @@ Item {
rotateAnimation.to = 0;
rotateAnimation.start();
}
-
- nextColorSection = Math.floor((value - min) / (max - min) * 3);
- if (nextColorSection < 0)
- nextColorSection = 0;
-
}
width: bg.width
@@ -107,35 +101,10 @@ Item {
source: pathPrefix + colorSections[currentColorSection]
}
- Image {
- id: fgNext
-
- anchors.centerIn: bg
- source: pathPrefix + colorSections[nextColorSection]
- rotation: fg.rotation
- onSourceChanged: visible = true
- opacity: fg.rotation / 360
- }
-
- SequentialAnimation {
+ RotationAnimator {
id: rotateAnimation
- property alias from: rot.from
- property alias to: rot.to
-
- PropertyAnimation {
- id: rot
-
- target: fg
- property: "rotation"
- duration: 500
- }
-
- ScriptAction {
- script: {
- fg.source = fgNext.source
- fgNext.visible = false;
- }
- }
+ target: fg
+ duration: 500
}
}