From 743eef0fdee28dab5bcf0677cd63c10dc6918a31 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 27 Oct 2016 12:02:34 +0200 Subject: [PATCH] feat(Popup): better transitions --- .../Common/Popup/AbstractDropDownMenu.qml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml index a340ec303..a9b50276a 100644 --- a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml +++ b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml @@ -60,7 +60,7 @@ Item { // ----------------------------------------------------------------- - implicitHeight: _computeHeight() + implicitHeight: 0 opacity: 0 visible: false z: Constants.zPopup @@ -76,7 +76,7 @@ Item { // Block clicks, wheel... below menu. MouseArea { - anchors.fill: content + anchors.fill: parent hoverEnabled: true onWheel: {} } @@ -115,6 +115,7 @@ Item { PropertyChanges { focus: true // Necessary to use `Keys.onEscapePressed`. + implicitHeight: _computeHeight() opacity: 1.0 target: menu } @@ -138,12 +139,26 @@ Item { property: 'opacity' target: menu } + + NumberAnimation { + duration: PopupStyle.animation.openingDuration + easing.type: Easing.InOutQuad + property: 'implicitHeight' + target: menu + } }, Transition { from: 'opened' to: '' + NumberAnimation { + duration: PopupStyle.animation.closingDuration + easing.type: Easing.InOutQuad + property: 'implicitHeight' + target: menu + } + SequentialAnimation { ScriptAction { script: menuClosed()