Last active
September 22, 2020 15:31
-
-
Save oKcerG/ba3bcbde9f9559c2443cd40f0b2edeb5 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.15 | |
import QtQml 2.15 | |
Behavior { | |
id: root | |
property QtObject fadeTarget: targetProperty.object | |
property string fadeProperty: "scale" | |
property int fadeDuration: 150 | |
property string easingType: "Quad" | |
property alias outAnimation: outAnimation | |
property alias inAnimation: inAnimation | |
SequentialAnimation { | |
NumberAnimation { | |
id: outAnimation | |
target: root.fadeTarget | |
property: root.fadeProperty | |
duration: root.fadeDuration | |
to: 0 | |
easing.type: Easing["In"+root.easingType] | |
} | |
PropertyAction { } | |
NumberAnimation { | |
id: inAnimation | |
target: root.fadeTarget | |
property: root.fadeProperty | |
duration: root.fadeDuration | |
to: target[property] | |
easing.type: Easing["Out"+root.easingType] | |
} | |
} | |
} |
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
FadeBehavior { | |
fadeProperty: "opacity" | |
fadeDuration: 200 | |
outAnimation.duration: targetValue ? 0 : fadeDuration | |
inAnimation.duration: targetValue ? fadeDuration : 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment