Merge lp:~dandrader/unity8/fixSpreadDelegateRotationAnimation into lp:unity8

Proposed by Daniel d'Andrada on 2016-05-31
Status: Merged
Approved by: Lukáš Tinkl on 2016-05-31
Approved revision: 2410
Merged at revision: 2471
Proposed branch: lp:~dandrader/unity8/fixSpreadDelegateRotationAnimation
Merge into: lp:unity8
Diff against target: 138 lines (+37/-17)
2 files modified
qml/Stages/OrientationChangeAnimation.qml (+30/-6)
qml/Stages/SpreadDelegate.qml (+7/-11)
To merge this branch: bzr merge lp:~dandrader/unity8/fixSpreadDelegateRotationAnimation
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2016-06-04
Lukáš Tinkl (community) 2016-05-31 Approve on 2016-05-31
Review via email: mp+296107@code.launchpad.net

Commit Message

Fix SpreadDelegate rotation animations

They were broken by the support for multi-surface applications.

Description of the Change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes. This is the easiest way to test:
- $ make trySpreadDelegate
- Click on "Load with gallery-app"
- Select "90" on the drop-down list for shellOrientationAngle
- Click on "animateToShellOrientation()"

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.

* If you changed the UI, has there been a design review?
Not applicable.

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2410
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1317/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1748
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/851
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/851
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/851
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1774
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1721
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1714/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1714
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1714/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1317/rebuild

review: Needs Fixing (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

Yup, works well

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

No (unrelated dash failure)

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2410
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1363/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1801
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/909
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/909
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/909
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1828
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1787
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1787
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1787
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1779/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1779
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1779/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1363/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/OrientationChangeAnimation.qml'
2--- qml/Stages/OrientationChangeAnimation.qml 2015-07-15 15:07:19 +0000
3+++ qml/Stages/OrientationChangeAnimation.qml 2016-05-31 13:54:41 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2015 Canonical Ltd.
7+ * Copyright 2015, 2016 Canonical Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11@@ -68,12 +68,22 @@
12 }
13 }
14
15- if (chosenAnimation)
16- chosenAnimation.start();
17+ if (chosenAnimation) {
18+ chosenAnimation.setup();
19+ }
20+ }
21+
22+ property Connections chosenAnimationConns: Connections {
23+ target: root.chosenAnimation
24+ onReadyChanged: {
25+ if (root.chosenAnimation.ready) {
26+ root.chosenAnimation.start();
27+ }
28+ }
29 }
30
31 // to be read from outside
32- property bool running: chosenAnimation ? chosenAnimation.running : false
33+ property bool running: chosenAnimation !== null
34
35 property int duration: 450
36 property int easingType: Easing.InOutCubic
37@@ -84,7 +94,7 @@
38 ? spreadDelegate.width : spreadDelegate.height
39 property string longestAxis: spreadDelegate.width > spreadDelegate.height ? "x" : "y"
40
41- property QtObject chosenAnimation
42+ property QtObject chosenAnimation: null
43
44 function setup90Animation() {
45 background.visible = true;
46@@ -92,7 +102,6 @@
47 screenshot.width = window.width;
48 screenshot.height = window.height;
49 screenshot.window.anchors.topMargin = window.window.anchors.topMargin;
50- screenshot.take();
51 screenshot.transformOriginX = root.shortestDimension / 2;
52 screenshot.transformOriginY = root.shortestDimension / 2;
53 screenshot.visible = true;
54@@ -109,11 +118,17 @@
55 screenshot.discard();
56 screenshot.visible = false;
57 background.visible = false;
58+ chosenAnimation.ranSetup = false;
59+ chosenAnimation = null;
60 }
61
62 property QtObject simple90Animation: SequentialAnimation {
63 id: simple90Animation
64
65+ function setup() { screenshot.take(); ranSetup = true; }
66+ property bool ranSetup: false
67+ readonly property bool ready: ranSetup && root.screenshot && root.screenshot.ready
68+
69 ScriptAction { script: setup90Animation() }
70 ParallelAnimation {
71 RotationAnimation {
72@@ -155,6 +170,10 @@
73 property QtObject moving90Animation: SequentialAnimation {
74 id: moving90Animation
75
76+ function setup() { screenshot.take(); ranSetup = true; }
77+ property bool ranSetup: false
78+ readonly property bool ready: ranSetup && root.screenshot && root.screenshot.ready
79+
80 ScriptAction { script: setup90Animation() }
81 ParallelAnimation {
82 RotationAnimation {
83@@ -214,6 +233,9 @@
84 property QtObject halfLoopAnimation: SequentialAnimation {
85 id: halfLoopAnimation
86
87+ function setup() { ready = true; }
88+ property bool ready: false
89+
90 ScriptAction { script: {
91 background.visible = true;
92
93@@ -236,6 +258,8 @@
94 ScriptAction { script: {
95 window.orientationAngle = spreadDelegate.shellOrientationAngle;
96 background.visible = false;
97+ chosenAnimation = null;
98+ halfLoopAnimation.ready = false;
99 } }
100 }
101 }
102
103=== modified file 'qml/Stages/SpreadDelegate.qml'
104--- qml/Stages/SpreadDelegate.qml 2016-04-27 15:01:10 +0000
105+++ qml/Stages/SpreadDelegate.qml 2016-05-31 13:54:41 +0000
106@@ -323,13 +323,14 @@
107 angle: appWindowScreenshotWithShadow.transformRotationAngle
108 }
109
110- property var window: appWindowScreenshot
111+ readonly property Item window: appWindowScreenshot
112+ readonly property bool ready: appWindowScreenshot.status === Image.Ready
113
114 function take() {
115- // Format: "image://application/$APP_ID/$CURRENT_TIME_MS"
116- // eg: "image://application/calculator-app/123456"
117- var timeMs = new Date().getTime();
118- appWindowScreenshot.source = "image://application/" + root.application.appId + "/" + timeMs;
119+ appWindow.grabToImage(
120+ function(result) {
121+ appWindowScreenshot.source = result.url;
122+ });
123 }
124 function discard() {
125 appWindowScreenshot.source = "";
126@@ -337,12 +338,7 @@
127
128 Image {
129 id: appWindowScreenshot
130- source: ""
131-
132- anchors.fill: parent
133-
134- sourceSize.width: width
135- sourceSize.height: height
136+ anchors.top: parent.top
137 }
138 }
139

Subscribers

People subscribed via source and target branches