on xenial help sign in
should fix tests
96e91a6Andrea Cimitan
qml/Dash/DashPageHeader.qml+29−29
@@ -145,6 +145,35 @@ Item {
145
145
146 property bool showSearch: false
146 property bool showSearch: false
147
147
148+ state: headerContainer.showSearch ? "search" : ""
149+
150+ states: State {
151+ name: "search"
152+
153+ AnchorChanges {
154+ target: headersColumn
155+ anchors.top: parent.top
156+ anchors.bottom: undefined
157+ }
158+ }
159+
160+ transitions: Transition {
161+ id: openSearchAnimation
162+ AnchorAnimation {
163+ duration: UbuntuAnimation.FastDuration
164+ }
165+
166+ property bool openPopup: false
167+
168+ onRunningChanged: {
169+ headerContainer.clip = running;
170+ if (!running && openSearchAnimation.openPopup) {
171+ openSearchAnimation.openPopup = false;
172+ root.openPopup();
173+ }
174+ }
175+ }
176+
148 Background {
177 Background {
149 id: background
178 id: background
150 objectName: "headerBackground"
179 objectName: "headerBackground"
@@ -159,35 +188,6 @@ Item {
159 bottom: parent.bottom
188 bottom: parent.bottom
160 }
189 }
161
190
162− state: headerContainer.showSearch ? "search" : ""
163−
164− states: State {
165− name: "search"
166−
167− AnchorChanges {
168− target: headersColumn
169− anchors.top: parent.top
170− anchors.bottom: undefined
171− }
172− }
173−
174− transitions: Transition {
175− id: openSearchAnimation
176− AnchorAnimation {
177− duration: UbuntuAnimation.FastDuration
178− }
179−
180− property bool openPopup: false
181−
182− onRunningChanged: {
183− headerContainer.clip = running;
184− if (!running && openSearchAnimation.openPopup) {
185− openSearchAnimation.openPopup = false;
186− root.openPopup();
187− }
188− }
189− }
190−
191 PageHeader {
191 PageHeader {
192 id: searchHeader
192 id: searchHeader
193 anchors { left: parent.left; right: parent.right }
193 anchors { left: parent.left; right: parent.right }
tests/qmltests/Dash/tst_DashContent.qml+6−3
@@ -320,7 +320,8 @@ Item {
320 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
320 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
321
321
322 var headerContainer = findChild(dashContentList.currentItem, "headerContainer");
322 var headerContainer = findChild(dashContentList.currentItem, "headerContainer");
323− tryCompare(headerContainer, "contentY", headerContainer.height);
323+ tryCompare(headerContainer, "clip", false);
324+ verify(headerContainer.state != "search");
324 mouseClick(searchButton);
325 mouseClick(searchButton);
325 tryCompare(peExtraPanel, "visible", true);
326 tryCompare(peExtraPanel, "visible", true);
326 waitForRendering(navigationListView);
327 waitForRendering(navigationListView);
@@ -384,7 +385,8 @@ Item {
384 mouseClick(header0);
385 mouseClick(header0);
385 compare(peExtraPanel.visible, false);
386 compare(peExtraPanel.visible, false);
386
387
387− tryCompare(headerContainer, "contentY", headerContainer.height);
388+ tryCompare(headerContainer, "clip", false);
389+ verify(headerContainer.state != "search");
388 mouseClick(searchButton);
390 mouseClick(searchButton);
389 tryCompare(peExtraPanel, "visible", true);
391 tryCompare(peExtraPanel, "visible", true);
390 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
392 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
@@ -544,7 +546,8 @@ Item {
544
546
545 mouseClick(cancelButton);
547 mouseClick(cancelButton);
546 tryCompare(headerContainer, "showSearch", false);
548 tryCompare(headerContainer, "showSearch", false);
547− tryCompare(headerContainer, "contentY", headerContainer.height);
549+ tryCompare(headerContainer, "clip", false);
550+ verify(headerContainer.state != "search");
548
551
549 // test within a navigation
552 // test within a navigation
550 goToSecondLevel();
553 goToSecondLevel();
tests/qmltests/Dash/tst_DashPageHeader.qml+4−2
@@ -37,13 +37,15 @@ Item {
37 property var headerContainer: findChild(pageHeader, "headerContainer")
37 property var headerContainer: findChild(pageHeader, "headerContainer")
38
38
39 function doTypeString(text) {
39 function doTypeString(text) {
40− tryCompare(headerContainer, "contentY", 0);
40+ tryCompare(headerContainer, "clip", false);
41+ compare(headerContainer.state, "search");
41 typeString(text);
42 typeString(text);
42 }
43 }
43
44
44 function doResetSearch() {
45 function doResetSearch() {
45 pageHeader.resetSearch();
46 pageHeader.resetSearch();
46− tryCompare(headerContainer, "contentY", headerContainer.height);
47+ tryCompare(headerContainer, "clip", false);
48+ verify(headerContainer.state != "search");
47 }
49 }
48
50
49 function init() {
51 function init() {