aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/material/StackView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/material/StackView.qml')
-rw-r--r--src/quickcontrols/material/StackView.qml41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/quickcontrols/material/StackView.qml b/src/quickcontrols/material/StackView.qml
index 241b91f2d7..c3182442a2 100644
--- a/src/quickcontrols/material/StackView.qml
+++ b/src/quickcontrols/material/StackView.qml
@@ -8,39 +8,56 @@ import QtQuick.Controls.Material
T.StackView {
id: control
+ component LineAnimation: NumberAnimation {
+ duration: 200
+ easing.type: Easing.OutCubic
+ }
+
+ component FadeIn: LineAnimation {
+ property: "opacity"
+ from: 0.0
+ to: 1.0
+ }
+
+ component FadeOut: LineAnimation {
+ property: "opacity"
+ from: 1.0
+ to: 0.0
+ }
+
popEnter: Transition {
// slide_in_left
- NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * -control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * -control.width; to: 0 }
+ FadeIn {}
}
popExit: Transition {
// slide_out_right
- NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * control.width; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * control.width }
+ FadeOut {}
}
pushEnter: Transition {
// slide_in_right
- NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0 }
+ FadeIn {}
}
pushExit: Transition {
// slide_out_left
- NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width }
+ FadeOut {}
}
replaceEnter: Transition {
// slide_in_right
- NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0 }
+ FadeIn {}
}
replaceExit: Transition {
// slide_out_left
- NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width; duration: 200; easing.type: Easing.OutCubic }
- NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
+ LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width }
+ FadeOut {}
}
}