From 4a0337379bd46e5363f092a7028e60f297ebd83c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 27 Oct 2016 11:13:46 +0200 Subject: [PATCH] feat(Popup): better transitions --- .../Common/Popup/AbstractDropDownMenu.qml | 36 +++++++------------ .../ui/modules/Common/Popup/DesktopPopup.qml | 12 +++---- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml index b6dc88ff8..a340ec303 100644 --- a/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml +++ b/tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml @@ -126,7 +126,10 @@ Item { to: 'opened' ScriptAction { - script: menu.visible = true + script: { + menu.visible = true + menuOpened() + } } NumberAnimation { @@ -135,39 +138,26 @@ Item { property: 'opacity' target: menu } - - SequentialAnimation { - PauseAnimation { - duration: PopupStyle.animation.openingDuration - } - - ScriptAction { - script: menuOpened() - } - } }, Transition { from: 'opened' to: '' - NumberAnimation { - duration: PopupStyle.animation.closingDuration - easing.type: Easing.InOutQuad - property: 'opacity' - target: menu - } - SequentialAnimation { - PauseAnimation { + ScriptAction { + script: menuClosed() + } + + NumberAnimation { duration: PopupStyle.animation.closingDuration + easing.type: Easing.InOutQuad + property: 'opacity' + target: menu } ScriptAction { - script: { - visible = false - menuClosed() - } + script: visible = false } } } diff --git a/tests/ui/modules/Common/Popup/DesktopPopup.qml b/tests/ui/modules/Common/Popup/DesktopPopup.qml index f7962e6f1..83e26d415 100644 --- a/tests/ui/modules/Common/Popup/DesktopPopup.qml +++ b/tests/ui/modules/Common/Popup/DesktopPopup.qml @@ -82,16 +82,12 @@ Item { from: 'opened' to: '' - NumberAnimation { - duration: PopupStyle.animation.closingDuration - easing.type: Easing.InOutQuad - property: 'opacity' - target: popup - } - SequentialAnimation { - PauseAnimation { + NumberAnimation { duration: PopupStyle.animation.closingDuration + easing.type: Easing.InOutQuad + property: 'opacity' + target: popup } ScriptAction {