mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 09:23:17 +02:00
Replace expand/collapse dialog animation with fade in/out
This commit is contained in:
parent
396a20c72d
commit
2a931119bd
1 changed files with 8 additions and 8 deletions
|
@ -31,7 +31,7 @@ DialogBase {
|
|||
* Support for animating the dialog in and out.
|
||||
*/
|
||||
enabled: false
|
||||
scale: 0.0
|
||||
opacity: 0.0
|
||||
|
||||
// The offscreen UI will enable an object, rather than manipulating it's
|
||||
// visibility, so that we can do animations in both directions. Because
|
||||
|
@ -40,20 +40,20 @@ DialogBase {
|
|||
// opacity, and then when the target animation value is reached, we can
|
||||
// modify the visibility
|
||||
onEnabledChanged: {
|
||||
scale = enabled ? 1.0 : 0.0
|
||||
opacity = enabled ? 1.0 : 0.0
|
||||
}
|
||||
|
||||
// The actual animator
|
||||
Behavior on scale {
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.InOutBounce
|
||||
duration: 300
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
// Once we're scaled to 0, disable the dialog's visibility
|
||||
onScaleChanged: {
|
||||
visible = (scale != 0.0);
|
||||
// Once we're transparent, disable the dialog's visibility
|
||||
onOpacityChanged: {
|
||||
visible = (opacity != 0.0);
|
||||
}
|
||||
|
||||
// Some dialogs should be destroyed when they become invisible,
|
||||
|
|
Loading…
Reference in a new issue