diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-28 13:53:36 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-28 14:29:57 +0000 |
commit | fce62e0d0fab90932f1afb7c1520b721f50cf7c1 (patch) | |
tree | bbb853f0eccc04f56d3654b66a0dbbc807e9a6d6 | |
parent | e50c199cac320696cd78e43f9c79ccedc130881c (diff) |
StackView: mirror transitions in right-to-left
Change-Id: I5a8a231be3fed56185066dd9d939d1b898083a68
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r-- | src/imports/controls/StackView.qml | 12 | ||||
-rw-r--r-- | src/imports/controls/material/StackView.qml | 12 | ||||
-rw-r--r-- | src/imports/controls/universal/StackView.qml | 6 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml index 3aadd37a..f0869307 100644 --- a/src/imports/controls/StackView.qml +++ b/src/imports/controls/StackView.qml @@ -43,37 +43,37 @@ T.StackView { //! [popEnter] popEnter: Transition { - XAnimator { from: -root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (root.mirrored ? -1 : 1) * -root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [popEnter] //! [popExit] popExit: Transition { - XAnimator { from: 0; to: root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * root.width; duration: 400; easing.type: Easing.OutCubic } } //! [popExit] //! [pushEnter] pushEnter: Transition { - XAnimator { from: root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (root.mirrored ? -1 : 1) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [pushEnter] //! [pushExit] pushExit: Transition { - XAnimator { from: 0; to: -root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * -root.width; duration: 400; easing.type: Easing.OutCubic } } //! [pushExit] //! [replaceEnter] replaceEnter: Transition { - XAnimator { from: root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (root.mirrored ? -1 : 1) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [replaceEnter] //! [replaceExit] replaceExit: Transition { - XAnimator { from: 0; to: -root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * -root.width; duration: 400; easing.type: Easing.OutCubic } } //! [replaceExit] } diff --git a/src/imports/controls/material/StackView.qml b/src/imports/controls/material/StackView.qml index 776188e6..c31c13d2 100644 --- a/src/imports/controls/material/StackView.qml +++ b/src/imports/controls/material/StackView.qml @@ -43,7 +43,7 @@ T.StackView { //! [popEnter] popEnter: Transition { // slide_in_left - NumberAnimation { property: "x"; from: 0.5 * -root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * -root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic } } //! [popEnter] @@ -51,7 +51,7 @@ T.StackView { //! [popExit] popExit: Transition { // slide_out_right - NumberAnimation { property: "x"; from: 0; to: 0.5 * root.width; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * root.width; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic } } //! [popExit] @@ -59,7 +59,7 @@ T.StackView { //! [pushEnter] pushEnter: Transition { // slide_in_right - NumberAnimation { property: "x"; from: 0.5 * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic } } //! [pushEnter] @@ -67,7 +67,7 @@ T.StackView { //! [pushExit] pushExit: Transition { // slide_out_left - NumberAnimation { property: "x"; from: 0; to: 0.5 * -root.width; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * -root.width; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic } } //! [pushExit] @@ -75,7 +75,7 @@ T.StackView { //! [replaceEnter] replaceEnter: Transition { // slide_in_right - NumberAnimation { property: "x"; from: 0.5 * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic } } //! [replaceEnter] @@ -83,7 +83,7 @@ T.StackView { //! [replaceExit] replaceExit: Transition { // slide_out_left - NumberAnimation { property: "x"; from: 0; to: 0.5 * -root.width; duration: 200; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * -root.width; duration: 200; easing.type: Easing.OutCubic } NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic } } //! [replaceExit] diff --git a/src/imports/controls/universal/StackView.qml b/src/imports/controls/universal/StackView.qml index b09359b6..b49c2dbb 100644 --- a/src/imports/controls/universal/StackView.qml +++ b/src/imports/controls/universal/StackView.qml @@ -45,7 +45,7 @@ T.StackView { popEnter: Transition { ParallelAnimation { NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200; easing.type: Easing.InQuint } - NumberAnimation { property: "x"; from: -root.width / 3; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.3 : 0.3) * -root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } } //! [popEnter] @@ -60,7 +60,7 @@ T.StackView { pushEnter: Transition { ParallelAnimation { NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200; easing.type: Easing.InQuint } - NumberAnimation { property: "x"; from: root.width / 3; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.3 : 0.3) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } } //! [pushEnter] @@ -75,7 +75,7 @@ T.StackView { replaceEnter: Transition { ParallelAnimation { NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200; easing.type: Easing.InQuint } - NumberAnimation { property: "x"; from: root.width / 3; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (root.mirrored ? -0.3 : 0.3) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } } //! [replaceEnter] |