diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-03 16:05:28 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-03 17:50:15 +0000 |
commit | dc78d00db6128ee53953b0cf01dcbfe236a849c3 (patch) | |
tree | 0449f383ba64213504bf443e0723bb4cdf0d85d0 | |
parent | d77d00b17c203fc08dcd34978ff35dbf154d2411 (diff) |
StackView: use control as root id like in all other controls
This makes it 100% clear in the doc snippets that the transitions are
referring to the stackview control.
Change-Id: I7c56b3669917f2f581972342c6b632738e0eb4fc
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r-- | src/imports/controls/StackView.qml | 14 | ||||
-rw-r--r-- | src/imports/controls/material/StackView.qml | 14 | ||||
-rw-r--r-- | src/imports/controls/universal/StackView.qml | 8 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml index f0869307..2de21885 100644 --- a/src/imports/controls/StackView.qml +++ b/src/imports/controls/StackView.qml @@ -39,41 +39,41 @@ import Qt.labs.controls 1.0 import Qt.labs.templates 1.0 as T T.StackView { - id: root + id: control //! [popEnter] popEnter: Transition { - XAnimator { from: (root.mirrored ? -1 : 1) * -root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [popEnter] //! [popExit] popExit: Transition { - XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic } } //! [popExit] //! [pushEnter] pushEnter: Transition { - XAnimator { from: (root.mirrored ? -1 : 1) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [pushEnter] //! [pushExit] pushExit: Transition { - XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * -root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic } } //! [pushExit] //! [replaceEnter] replaceEnter: Transition { - XAnimator { from: (root.mirrored ? -1 : 1) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } //! [replaceEnter] //! [replaceExit] replaceExit: Transition { - XAnimator { from: 0; to: (root.mirrored ? -1 : 1) * -root.width; duration: 400; easing.type: Easing.OutCubic } + XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.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 c31c13d2..0eb14832 100644 --- a/src/imports/controls/material/StackView.qml +++ b/src/imports/controls/material/StackView.qml @@ -38,12 +38,12 @@ import QtQuick 2.4 import Qt.labs.templates 1.0 as T T.StackView { - id: root + id: control //! [popEnter] popEnter: Transition { // slide_in_left - NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * -root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [popEnter] @@ -51,7 +51,7 @@ T.StackView { //! [popExit] popExit: Transition { // slide_out_right - NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * root.width; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [popExit] @@ -59,7 +59,7 @@ T.StackView { //! [pushEnter] pushEnter: Transition { // slide_in_right - NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [pushEnter] @@ -67,7 +67,7 @@ T.StackView { //! [pushExit] pushExit: Transition { // slide_out_left - NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * -root.width; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [pushExit] @@ -75,7 +75,7 @@ T.StackView { //! [replaceEnter] replaceEnter: Transition { // slide_in_right - NumberAnimation { property: "x"; from: (root.mirrored ? -0.5 : 0.5) * root.width; to: 0; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [replaceEnter] @@ -83,7 +83,7 @@ T.StackView { //! [replaceExit] replaceExit: Transition { // slide_out_left - NumberAnimation { property: "x"; from: 0; to: (root.mirrored ? -0.5 : 0.5) * -root.width; duration: 200; easing.type: Easing.OutCubic } + 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 } } //! [replaceExit] diff --git a/src/imports/controls/universal/StackView.qml b/src/imports/controls/universal/StackView.qml index b49c2dbb..cbc5665d 100644 --- a/src/imports/controls/universal/StackView.qml +++ b/src/imports/controls/universal/StackView.qml @@ -39,13 +39,13 @@ import Qt.labs.templates 1.0 as T import Qt.labs.controls.universal 1.0 T.StackView { - id: root + id: control //! [popEnter] popEnter: Transition { ParallelAnimation { NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200; easing.type: Easing.InQuint } - NumberAnimation { property: "x"; from: (root.mirrored ? -0.3 : 0.3) * -root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (control.mirrored ? -0.3 : 0.3) * -control.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.mirrored ? -0.3 : 0.3) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (control.mirrored ? -0.3 : 0.3) * control.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.mirrored ? -0.3 : 0.3) * root.width; to: 0; duration: 400; easing.type: Easing.OutCubic } + NumberAnimation { property: "x"; from: (control.mirrored ? -0.3 : 0.3) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } } //! [replaceEnter] |