From f8837693091580d1076594d240c46b87a958ef29 Mon Sep 17 00:00:00 2001 From: Titta Heikkala Date: Thu, 23 Feb 2017 10:13:55 +0200 Subject: iot-sensortag: Remove transparent image from object temperature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The transparent image is not needed for object temperature cauge. Change-Id: I8880f0ef3c84a382a7bfc9cdaf867e901fbf6219 Reviewed-by: Kari Hautamäki --- .../iot-sensortag/resources/base/CircularGauge.qml | 41 +++------------------- 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'tradeshow/iot-sensortag/resources/base/CircularGauge.qml') 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 } } -- cgit v1.2.3