Commit 4a033737 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Popup): better transitions

parent 9976c543
...@@ -126,7 +126,10 @@ Item { ...@@ -126,7 +126,10 @@ Item {
to: 'opened' to: 'opened'
ScriptAction { ScriptAction {
script: menu.visible = true script: {
menu.visible = true
menuOpened()
}
} }
NumberAnimation { NumberAnimation {
...@@ -135,22 +138,17 @@ Item { ...@@ -135,22 +138,17 @@ Item {
property: 'opacity' property: 'opacity'
target: menu target: menu
} }
SequentialAnimation {
PauseAnimation {
duration: PopupStyle.animation.openingDuration
}
ScriptAction {
script: menuOpened()
}
}
}, },
Transition { Transition {
from: 'opened' from: 'opened'
to: '' to: ''
SequentialAnimation {
ScriptAction {
script: menuClosed()
}
NumberAnimation { NumberAnimation {
duration: PopupStyle.animation.closingDuration duration: PopupStyle.animation.closingDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
...@@ -158,16 +156,8 @@ Item { ...@@ -158,16 +156,8 @@ Item {
target: menu target: menu
} }
SequentialAnimation {
PauseAnimation {
duration: PopupStyle.animation.closingDuration
}
ScriptAction { ScriptAction {
script: { script: visible = false
visible = false
menuClosed()
}
} }
} }
} }
......
...@@ -82,6 +82,7 @@ Item { ...@@ -82,6 +82,7 @@ Item {
from: 'opened' from: 'opened'
to: '' to: ''
SequentialAnimation {
NumberAnimation { NumberAnimation {
duration: PopupStyle.animation.closingDuration duration: PopupStyle.animation.closingDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
...@@ -89,11 +90,6 @@ Item { ...@@ -89,11 +90,6 @@ Item {
target: popup target: popup
} }
SequentialAnimation {
PauseAnimation {
duration: PopupStyle.animation.closingDuration
}
ScriptAction { ScriptAction {
script: popup.hide() script: popup.hide()
} }
......
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