From 1918e89a0d11a77495c6be593a184850ef2fb0a7 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Fri, 2 Apr 2021 14:36:22 -0400 Subject: [PATCH] Continue work on animation This *still* doesn't work. --- resources/qml/MobileMessageContextPopup.qml | 72 ++++++++------------- 1 file changed, 26 insertions(+), 46 deletions(-) diff --git a/resources/qml/MobileMessageContextPopup.qml b/resources/qml/MobileMessageContextPopup.qml index 9ef870f0..fa603d52 100644 --- a/resources/qml/MobileMessageContextPopup.qml +++ b/resources/qml/MobileMessageContextPopup.qml @@ -22,6 +22,11 @@ Item { model = undefined } + state: "hidden" + visible: false + property Item attached: null + property alias model: row.model + // TODO: make this work states: [ State { @@ -41,6 +46,7 @@ Item { PropertyChanges { target: overlay visible: false + opacity: 0 } }, State { @@ -60,10 +66,10 @@ Item { PropertyChanges { target: overlay visible: true + opacity: 1 } } ] - state: "hidden" transitions: [ Transition { @@ -71,32 +77,24 @@ Item { to: "shown" SequentialAnimation { - ParallelAnimation { - NumberAnimation { - target: popupRoot - property: "visible" - duration: 0 - } - - NumberAnimation { - target: popup - property: "visible" - duration: 0 - } + NumberAnimation { + targets: [popupRoot, popup, overlay] + properties: "visible" + duration: 0 } ParallelAnimation { NumberAnimation { target: popup property: "y" - duration: 500 + duration: 250 easing.type: Easing.InOutQuad } NumberAnimation { target: overlay - property: "visible" - duration: 500 + property: "opacity" + duration: 250 easing.type: Easing.InQuad } } @@ -112,38 +110,27 @@ Item { NumberAnimation { target: popup property: "y" - duration: 500 + duration: 250 easing.type: Easing.InOutQuad } NumberAnimation { target: overlay - property: "visible" - duration: 500 + property: "opacity" + duration: 250 easing.type: Easing.InQuad } } - ParallelAnimation { - NumberAnimation { - target: popupRoot - property: "visible" - duration: 0 - } - - NumberAnimation { - target: popup - property: "visible" - duration: 0 - } + NumberAnimation { + targets: [popupRoot, popup, overlay] + properties: "visible" + duration: 0 } } } ] - property Item attached: null - property alias model: row.model - Rectangle { id: popup @@ -256,24 +243,17 @@ Item { } } - Rectangle { + FastBlur { id: overlay anchors.fill: parent + source: timelineRoot + radius: 50 z: popupBottomBar.z - 1 - - color: "gray" - opacity: 0.5 + visible: false + opacity: 0 TapHandler { onTapped: popupRoot.hide() } - - // TODO: this needs some work; it doesn't blur very well - FastBlur { - z: overlay.z - 1 - anchors.fill: parent - source: timelineRoot - radius: 50 - } } }