Changed the glass animations to a more bubble-like animation
This commit is contained in:
@@ -51,31 +51,47 @@ ModuleChip {
|
||||
|
||||
property real progressVal: 1.0
|
||||
property bool slideFromRight: false
|
||||
|
||||
property real slideX: slideFromRight ? (width + 20) : -(width + 20)
|
||||
|
||||
transform: Translate { id: slideTranslate; x: toastRoot.slideX }
|
||||
transform: [
|
||||
Translate { id: slideTranslate; x: toastRoot.slideX },
|
||||
Scale { id: bubbleScale; yScale: 0; origin.y: toastLayer.atBottom ? toastRoot.height : 0 }
|
||||
]
|
||||
|
||||
Component.onCompleted: entranceSlide.start()
|
||||
Component.onCompleted: entranceAnim.start()
|
||||
|
||||
NumberAnimation {
|
||||
id: entranceSlide
|
||||
target: slideTranslate; property: "x"
|
||||
from: toastRoot.slideX; to: 0
|
||||
duration: 300; easing.type: Easing.OutCubic
|
||||
ParallelAnimation {
|
||||
id: entranceAnim
|
||||
NumberAnimation {
|
||||
target: slideTranslate; property: "x"
|
||||
from: toastRoot.slideX; to: 0
|
||||
duration: 320; easing.type: Easing.OutCubic
|
||||
}
|
||||
NumberAnimation {
|
||||
target: bubbleScale; property: "yScale"
|
||||
from: 0; to: 1
|
||||
duration: 280; easing.type: Easing.OutBack
|
||||
}
|
||||
}
|
||||
|
||||
function triggerDismiss() {
|
||||
if (exitSlide.running) return
|
||||
if (exitAnim.running) return
|
||||
autoTimer.stop()
|
||||
exitSlide.start()
|
||||
exitAnim.start()
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
id: exitSlide
|
||||
target: slideTranslate; property: "x"
|
||||
to: toastRoot.slideX
|
||||
duration: 220; easing.type: Easing.InCubic
|
||||
ParallelAnimation {
|
||||
id: exitAnim
|
||||
NumberAnimation {
|
||||
target: slideTranslate; property: "x"
|
||||
to: toastRoot.slideX
|
||||
duration: 250; easing.type: Easing.InCubic
|
||||
}
|
||||
NumberAnimation {
|
||||
target: bubbleScale; property: "yScale"
|
||||
from: 1; to: 0
|
||||
duration: 200; easing.type: Easing.InBack
|
||||
}
|
||||
onStopped: toastRoot.dismissed(toastRoot.toastId)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user