mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:47:41 +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.
|
* Support for animating the dialog in and out.
|
||||||
*/
|
*/
|
||||||
enabled: false
|
enabled: false
|
||||||
scale: 0.0
|
opacity: 0.0
|
||||||
|
|
||||||
// The offscreen UI will enable an object, rather than manipulating it's
|
// The offscreen UI will enable an object, rather than manipulating it's
|
||||||
// visibility, so that we can do animations in both directions. Because
|
// 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
|
// opacity, and then when the target animation value is reached, we can
|
||||||
// modify the visibility
|
// modify the visibility
|
||||||
onEnabledChanged: {
|
onEnabledChanged: {
|
||||||
scale = enabled ? 1.0 : 0.0
|
opacity = enabled ? 1.0 : 0.0
|
||||||
}
|
}
|
||||||
|
|
||||||
// The actual animator
|
// The actual animator
|
||||||
Behavior on scale {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: 300
|
||||||
easing.type: Easing.InOutBounce
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once we're scaled to 0, disable the dialog's visibility
|
// Once we're transparent, disable the dialog's visibility
|
||||||
onScaleChanged: {
|
onOpacityChanged: {
|
||||||
visible = (scale != 0.0);
|
visible = (opacity != 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some dialogs should be destroyed when they become invisible,
|
// Some dialogs should be destroyed when they become invisible,
|
||||||
|
|
Loading…
Reference in a new issue