Created
August 9, 2018 07:22
-
-
Save oKcerG/9a78c74808b8a652d17ce3ba98e09cf4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
SequentialAnimation { | |
id: root | |
property QtObject target | |
property string fadeProperty: "opacity" | |
property int fadeDuration: 150 | |
property alias outValue: outAnimation.to | |
property alias inValue: inAnimation.to | |
property alias outEasingType: outAnimation.easing.type | |
property alias inEasingType: inAnimation.easing.type | |
property string easingType: "Quad" | |
NumberAnimation { | |
id: outAnimation | |
target: root.target | |
property: root.fadeProperty | |
duration: root.target.visible ? root.fadeDuration : 0 | |
to: 0 | |
easing.type: Easing["In"+root.easingType] | |
} | |
PropertyAction { } // actually change the property between the 2 other animations | |
NumberAnimation { | |
id: inAnimation | |
target: root.target | |
property: root.fadeProperty | |
duration: root.target.visible ? 0 : root.fadeDuration // the duration seems to be read at the start of the SequentialAnimation or Behavior | |
to: 1 | |
easing.type: Easing["Out"+root.easingType] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment