From 9ae5eba12a6b9d6d2b90d63fb0e6fccf740af5a7 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 15 Aug 2019 13:04:50 -0700 Subject: [PATCH] Remove reliance on QML timer - still need to fix non-circular emoji mask --- .../ui/qml/ProgressCircle/ProgressCircle.qml | 6 +-- .../emojiApp/ui/qml/SimplifiedEmoji.qml | 46 +++++++------------ 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/ProgressCircle/ProgressCircle.qml b/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/ProgressCircle/ProgressCircle.qml index 46f1c03848..9e3031a392 100644 --- a/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/ProgressCircle/ProgressCircle.qml +++ b/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/ProgressCircle/ProgressCircle.qml @@ -12,7 +12,7 @@ Item { property int size: 200 // The size of the circle in pixel property real arcBegin: 0 // start arc angle in degree - property real arcEnd: 270 // end arc angle in degree + property real arcEnd: 360 // end arc angle in degree property real arcOffset: 0 // rotation property bool isPie: false // paint a pie instead of an arc property bool showBackground: false // a full circle as a background of the arc @@ -39,10 +39,10 @@ Item { Behavior on arcEnd { id: animationArcEnd - enabled: false + enabled: true NumberAnimation { duration: root.animationDuration - easing.type: Easing.InOutCubic + easing.type: Easing.OutQuad } } diff --git a/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/SimplifiedEmoji.qml b/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/SimplifiedEmoji.qml index dea921151a..fb5015740d 100644 --- a/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/SimplifiedEmoji.qml +++ b/scripts/simplifiedUI/simplifiedEmote/emojiApp/ui/qml/SimplifiedEmoji.qml @@ -94,16 +94,6 @@ Rectangle { clip: true color: simplifiedUI.colors.darkBackground - Image { - id: mainEmojiImage - width: 180 - height: 180 - anchors.centerIn: parent - source: "" - fillMode: Image.PreserveAspectFit - visible: false - } - Image { id: mainEmojiLowOpacity width: 180 @@ -115,10 +105,20 @@ Rectangle { visible: true } + Image { + id: mainEmojiImage + width: 180 + height: 180 + anchors.centerIn: parent + source: "" + fillMode: Image.PreserveAspectFit + visible: false + } + // The overlay used during the pie timeout ProgressCircle { - property int arcChangeSize: 15 id: progressCircle + animationDuration: 7000 // Must match `TOTAL_EMOJI_DURATION_MS` in `simplifiedEmoji.js` anchors.centerIn: mainEmojiImage size: mainEmojiImage.width * 2 opacity: 0.5 @@ -127,7 +127,7 @@ Rectangle { showBackground: false isPie: true arcBegin: 0 - arcEnd: 0 + arcEnd: 360 visible: false } @@ -136,16 +136,6 @@ Rectangle { source: mainEmojiImage maskSource: progressCircle } - - Timer { - id: arcTimer - interval: 5000 - repeat: true - running: false - onTriggered: { - progressCircle.arcEnd = ((progressCircle.arcEnd - progressCircle.arcChangeSize) > 0) ? (progressCircle.arcEnd - progressCircle.arcChangeSize) : 0; - } - } } Rectangle { @@ -283,16 +273,14 @@ Rectangle { switch(message.method) { case "beginCountdownTimer": - var degreesInCircle = 360; - progressCircle.arcEnd = degreesInCircle; - arcTimer.interval = message.data.interval; - progressCircle.arcChangeSize = degreesInCircle / (message.data.duration / arcTimer.interval); - arcTimer.start(); + progressCircle.endAnimation = true; + progressCircle.arcEnd = 0; root.isSelected = true; break; case "clearCountdownTimer": - progressCircle.arcEnd = 0; - arcTimer.stop(); + progressCircle.endAnimation = false; + progressCircle.arcEnd = 360; + progressCircle.endAnimation = true; root.isSelected = false; break; default: