Merge lp:~cimi/unity8/fix-dashHeader-rotation into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Josh Arenson
Approved revision: 2537
Merged at revision: 2565
Proposed branch: lp:~cimi/unity8/fix-dashHeader-rotation
Merge into: lp:unity8
Diff against target: 158 lines (+49/-28)
3 files modified
qml/Dash/DashPageHeader.qml (+37/-21)
tests/qmltests/Dash/tst_DashContent.qml (+7/-4)
tests/qmltests/Dash/tst_DashPageHeader.qml (+5/-3)
To merge this branch: bzr merge lp:~cimi/unity8/fix-dashHeader-rotation
Reviewer Review Type Date Requested Status
Josh Arenson Approve
Albert Astals Cid (community) Approve
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+299404@code.launchpad.net

Commit message

Replace Flickable with an Item inside DashPageHeader for headerContainer

Description of the change

I replaced the Flickable inside the DashPageHeader with an Item and a state, items are now anchored and shouldn't move around while resizing

 * Are there any related MPs required for this MP to build/function as expected? Please list.
n
 * Did you perform an exploratory manual test run of your code change and any related functionality?
y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
n/a

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

FAILED: Continuous integration, rev:2533
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1684/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2231
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1193
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1193
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1193
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2259
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2165
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2165
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2165
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2156/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

uuups looks like my branch breaks tests / having a look

2534. By Andrea Cimitan

should fix tests

Revision history for this message
Josh Arenson (josharenson) wrote :

Please update the copyright in all 3 files.
Some small inline comments.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2534
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1686/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2233
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1195
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1195
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1195
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2261
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2167
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2167
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2167
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2158/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2158
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2158/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
2535. By Andrea Cimitan

as review

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2535
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1694/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2241
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1203
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1203
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1203
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2269
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2175
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2175
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2175
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2166/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2166
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2166/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

The animation easing needs fixing, see inline comment.

review: Needs Fixing
2536. By Andrea Cimitan

use ubuntuanimation easing

Revision history for this message
Andrea Cimitan (cimi) wrote :

> The animation easing needs fixing, see inline comment.
nice one, done

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good to me, will let Josh do the final top-approval since he is the original reviewer

review: Approve
2537. By Andrea Cimitan

add copyright years

Revision history for this message
Josh Arenson (josharenson) wrote :

* 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, but unrelated. Changes made since last run won't affect results either.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/DashPageHeader.qml'
2--- qml/Dash/DashPageHeader.qml 2016-05-17 20:46:51 +0000
3+++ qml/Dash/DashPageHeader.qml 2016-07-11 15:01:25 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2013,2015 Canonical, Ltd.
7+ * Copyright (C) 2013,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 General Public License as published by
11@@ -137,41 +137,57 @@
12 }
13 }
14
15- Flickable {
16+ Item {
17 id: headerContainer
18 objectName: "headerContainer"
19- clip: contentY < height
20 anchors { left: parent.left; top: parent.top; right: parent.right }
21 height: header.__styleInstance.contentHeight
22- contentHeight: headersColumn.height
23- interactive: false
24- contentY: showSearch ? 0 : height
25
26 property bool showSearch: false
27
28+ state: headerContainer.showSearch ? "search" : ""
29+
30+ states: State {
31+ name: "search"
32+
33+ AnchorChanges {
34+ target: headersColumn
35+ anchors.top: parent.top
36+ anchors.bottom: undefined
37+ }
38+ }
39+
40+ transitions: Transition {
41+ id: openSearchAnimation
42+ AnchorAnimation {
43+ duration: UbuntuAnimation.FastDuration
44+ easing: UbuntuAnimation.StandardEasing
45+ }
46+
47+ property bool openPopup: false
48+
49+ onRunningChanged: {
50+ headerContainer.clip = running;
51+ if (!running && openSearchAnimation.openPopup) {
52+ openSearchAnimation.openPopup = false;
53+ root.openPopup();
54+ }
55+ }
56+ }
57+
58 Background {
59 id: background
60 objectName: "headerBackground"
61 style: scopeStyle.headerBackground
62 }
63
64- Behavior on contentY {
65- UbuntuNumberAnimation {
66- id: openSearchAnimation
67- property bool openPopup: false
68-
69- onRunningChanged: {
70- if (!running && openSearchAnimation.openPopup) {
71- openSearchAnimation.openPopup = false;
72- root.openPopup();
73- }
74- }
75- }
76- }
77-
78 Column {
79 id: headersColumn
80- anchors { left: parent.left; right: parent.right }
81+ anchors {
82+ left: parent.left
83+ right: parent.right
84+ bottom: parent.bottom
85+ }
86
87 PageHeader {
88 id: searchHeader
89
90=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
91--- tests/qmltests/Dash/tst_DashContent.qml 2016-06-21 08:20:32 +0000
92+++ tests/qmltests/Dash/tst_DashContent.qml 2016-07-11 15:01:25 +0000
93@@ -1,5 +1,5 @@
94 /*
95- * Copyright 2013 Canonical Ltd.
96+ * Copyright (C) 2013,2016 Canonical Ltd.
97 *
98 * This program is free software; you can redistribute it and/or modify
99 * it under the terms of the GNU General Public License as published by
100@@ -320,7 +320,8 @@
101 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
102
103 var headerContainer = findChild(dashContentList.currentItem, "headerContainer");
104- tryCompare(headerContainer, "contentY", headerContainer.height);
105+ tryCompare(headerContainer, "clip", false);
106+ verify(headerContainer.state !== "search");
107 mouseClick(searchButton);
108 tryCompare(peExtraPanel, "visible", true);
109 waitForRendering(navigationListView);
110@@ -384,7 +385,8 @@
111 mouseClick(header0);
112 compare(peExtraPanel.visible, false);
113
114- tryCompare(headerContainer, "contentY", headerContainer.height);
115+ tryCompare(headerContainer, "clip", false);
116+ verify(headerContainer.state !== "search");
117 mouseClick(searchButton);
118 tryCompare(peExtraPanel, "visible", true);
119 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
120@@ -544,7 +546,8 @@
121
122 mouseClick(cancelButton);
123 tryCompare(headerContainer, "showSearch", false);
124- tryCompare(headerContainer, "contentY", headerContainer.height);
125+ tryCompare(headerContainer, "clip", false);
126+ verify(headerContainer.state !== "search");
127
128 // test within a navigation
129 goToSecondLevel();
130
131=== modified file 'tests/qmltests/Dash/tst_DashPageHeader.qml'
132--- tests/qmltests/Dash/tst_DashPageHeader.qml 2016-05-27 13:52:20 +0000
133+++ tests/qmltests/Dash/tst_DashPageHeader.qml 2016-07-11 15:01:25 +0000
134@@ -1,5 +1,5 @@
135 /*
136- * Copyright 2013,2015 Canonical Ltd.
137+ * Copyright (C) 2013,2015,2016 Canonical Ltd.
138 *
139 * This program is free software; you can redistribute it and/or modify
140 * it under the terms of the GNU General Public License as published by
141@@ -37,13 +37,15 @@
142 property var headerContainer: findChild(pageHeader, "headerContainer")
143
144 function doTypeString(text) {
145- tryCompare(headerContainer, "contentY", 0);
146+ tryCompare(headerContainer, "clip", false);
147+ compare(headerContainer.state, "search");
148 typeString(text);
149 }
150
151 function doResetSearch() {
152 pageHeader.resetSearch();
153- tryCompare(headerContainer, "contentY", headerContainer.height);
154+ tryCompare(headerContainer, "clip", false);
155+ verify(headerContainer.state !== "search");
156 }
157
158 function init() {

Subscribers

People subscribed via source and target branches