on xenial help sign in
better animation
commit552be8091c65272ffd75eb968bc133e9c61e8210 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 29 Aug 2014, 17:30 (12 years ago) parent078e140
3 files changed+16−21
qml/Stages/Animations/BaseSessionAnimation.qml+2−3 qml/Stages/Animations/SwipeFromBottomAnimation.qml+12−12 qml/Stages/SessionContainer.qml+2−6
qml/Stages/Animations/BaseSessionAnimation.qml+2−3
@@ -37,8 +37,7 @@ import QtQuick 2.0
3737 */
3838Item {
3939 id: base
40− property var sessionContainer
41− property var surfaceContainer
40+ property var container
4241
4342
4443 // changes applied when state changes to "in"
@@ -63,7 +62,7 @@ Item {
6362 states: [
6463 State {
6564 name: "baseAnimation"
66− PropertyChanges { target: surfaceContainer; anchors.fill: undefined }
65+ PropertyChanges { target: container; anchors.fill: undefined }
6766 },
6867
6968 State {
qml/Stages/Animations/SwipeFromBottomAnimation.qml+12−12
@@ -21,32 +21,32 @@ BaseSessionAnimation {
2121 id: animation
2222
2323 outChanges: [ AnchorChanges {
24− target: surfaceContainer;
25− anchors.top: sessionContainer.bottom
26− anchors.right: sessionContainer.right
27− anchors.left: sessionContainer.left
24+ target: container;
25+ anchors.top: container.parent.bottom
26+ anchors.right: container.parent.right
27+ anchors.left: container.parent.left
2828 }
2929 ]
3030 outAnimations: [
3131 SequentialAnimation {
32− PropertyAction { target: sessionContainer; property: "clip"; value: true }
32+ PropertyAction { target: container.parent; property: "clip"; value: true }
3333 AnchorAnimation { easing: UbuntuAnimation.StandardEasing; duration: UbuntuAnimation.BriskDuration }
34− PropertyAction { target: sessionContainer; property: "clip"; value: false }
35− ScriptAction { script: { sessionContainer.session.release(); } }
34+ PropertyAction { target: container.parent; property: "clip"; value: false }
35+ ScriptAction { script: { container.session.release(); } }
3636 }
3737 ]
3838
3939 inChanges: [
4040 AnchorChanges {
41− target: surfaceContainer;
42− anchors.top: sessionContainer.top
43− anchors.bottom: sessionContainer.bottom
41+ target: container;
42+ anchors.top: container.parent.top
43+ anchors.bottom: container.parent.bottom
4444 } ]
4545 inAnimations: [
4646 SequentialAnimation {
47− PropertyAction { target: sessionContainer; property: "clip"; value: true }
47+ PropertyAction { target: container.parent; property: "clip"; value: true }
4848 AnchorAnimation { easing: UbuntuAnimation.StandardEasing; duration: UbuntuAnimation.BriskDuration }
49− PropertyAction { target: sessionContainer; property: "clip"; value: false }
49+ PropertyAction { target: container.parent; property: "clip"; value: false }
5050 }
5151 ]
5252}
qml/Stages/SessionContainer.qml+2−6
@@ -21,7 +21,7 @@ Item {
2121 id: root
2222 objectName: "sessionContainer"
2323 property QtObject session
24− property var childSessions: session ? session.childSessions : 0
24+ property var childSessions: session ? session.childSessions : null
2525 property alias surface: _surfaceContainer.surface
2626 property bool interactive: true
2727
@@ -82,11 +82,7 @@ Item {
8282 }
8383
8484 function animateIn() {
85− var animation = swipeFromBottom.createObject(root,
86− {
87− "sessionContainer": root,
88− "surfaceContainer": surfaceContainer
89− });
85+ var animation = swipeFromBottom.createObject(root, { "container": root, });
9086 animation.start();
9187
9288 var tmp = d.animations;