Commit 743eef0f authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Popup): better transitions

parent 5be1c604
...@@ -60,7 +60,7 @@ Item { ...@@ -60,7 +60,7 @@ Item {
// ----------------------------------------------------------------- // -----------------------------------------------------------------
implicitHeight: _computeHeight() implicitHeight: 0
opacity: 0 opacity: 0
visible: false visible: false
z: Constants.zPopup z: Constants.zPopup
...@@ -76,7 +76,7 @@ Item { ...@@ -76,7 +76,7 @@ Item {
// Block clicks, wheel... below menu. // Block clicks, wheel... below menu.
MouseArea { MouseArea {
anchors.fill: content anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onWheel: {} onWheel: {}
} }
...@@ -115,6 +115,7 @@ Item { ...@@ -115,6 +115,7 @@ Item {
PropertyChanges { PropertyChanges {
focus: true // Necessary to use `Keys.onEscapePressed`. focus: true // Necessary to use `Keys.onEscapePressed`.
implicitHeight: _computeHeight()
opacity: 1.0 opacity: 1.0
target: menu target: menu
} }
...@@ -138,12 +139,26 @@ Item { ...@@ -138,12 +139,26 @@ Item {
property: 'opacity' property: 'opacity'
target: menu target: menu
} }
NumberAnimation {
duration: PopupStyle.animation.openingDuration
easing.type: Easing.InOutQuad
property: 'implicitHeight'
target: menu
}
}, },
Transition { Transition {
from: 'opened' from: 'opened'
to: '' to: ''
NumberAnimation {
duration: PopupStyle.animation.closingDuration
easing.type: Easing.InOutQuad
property: 'implicitHeight'
target: menu
}
SequentialAnimation { SequentialAnimation {
ScriptAction { ScriptAction {
script: menuClosed() script: menuClosed()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment