on xenial help sign in
Fix some tests
commitd14f9b14305b453ba694816ce9342f7fafe8ab02 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 6 Nov 2015, 16:45 (11 years ago) parentec80215
5 files changed+14−25
qml/Dash/DashPageHeader.qml+6−18 qml/Dash/GenericScopeView.qml+2−1 tests/qmltests/Dash/tst_DashContent.qml+4−4 tests/qmltests/Dash/tst_GenericScopeView.qml+1−1 tests/qmltests/Dash/tst_PreviewListView.qml+1−1
qml/Dash/DashPageHeader.qml+6−18
@@ -24,7 +24,7 @@ import "../Components"
2424Item {
2525 id: root
2626 objectName: "pageHeader"
27− implicitHeight: headerContainer.height + bottomContainer.height + signatureLineHeight
27+ implicitHeight: headerContainer.height + signatureLineHeight
2828 readonly property real signatureLineHeight: showSignatureLine ? units.gu(2) : 0
2929
3030 property bool showBackButton: false
@@ -43,7 +43,6 @@ Item {
4343 property alias searchHint: searchTextField.placeholderText
4444 property bool showSignatureLine: true
4545
46− property alias bottomItem: bottomContainer.children
4746 property int paginationCount: 0
4847 property int paginationIndex: -1
4948
@@ -127,9 +126,10 @@ Item {
127126 }
128127
129128 InverseMouseArea {
130− anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + bottomContainer.height }
129+ anchors { fill: parent; margins: units.gu(1); bottomMargin: units.gu(3) + (extraPanel ? extraPanel.height : 0) }
131130 visible: headerContainer.showSearch
132131 onPressed: {
132+ extraPanel.visible = false;
133133 closePopup(/* keepFocus */false);
134134 mouse.accepted = false;
135135 }
@@ -276,7 +276,6 @@ Item {
276276 property color panelColor: background.topColor
277277 panelForegroundColor: config.foregroundColor
278278 config: PageHeadConfiguration {
279− title: root.title
280279 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
281280 backAction: Action {
282281 iconName: backIsClose ? "close" : "back"
@@ -326,7 +325,7 @@ Item {
326325 right: parent.right
327326 verticalCenter: parent.verticalCenter
328327 }
329− text: header.title
328+ text: root.title
330329 font.weight: header.fontWeight
331330 fontSize: header.fontSize
332331 color: header.panelForegroundColor
@@ -372,7 +371,7 @@ Item {
372371 top: headerContainer.bottom
373372 left: parent.left
374373 right: parent.right
375− bottom: bottomContainer.top
374+ bottom: parent.bottom
376375 }
377376
378377 color: root.scopeStyle ? root.scopeStyle.headerDividerColor : "#e0e0e0"
@@ -413,7 +412,7 @@ Item {
413412 id: bottomHighlight
414413 visible: bottomBorder.visible
415414 anchors {
416− top: bottomContainer.top
415+ top: parent.bottom
417416 left: parent.left
418417 right: parent.right
419418 }
@@ -436,15 +435,4 @@ Item {
436435 } else "#CCFFFFFF"
437436 }
438437 }
439−
440− Item {
441− id: bottomContainer
442−
443− anchors {
444− left: parent.left
445− right: parent.right
446− bottom: parent.bottom
447− }
448− height: childrenRect.height
449− }
450438}
qml/Dash/GenericScopeView.qml+2−1
@@ -626,7 +626,7 @@ FocusScope {
626626 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
627627 favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
628628 favorite: scopeView.scope && scopeView.scope.favorite
629− navigationTag: scopeView.scope && scopeView.scope.primaryNavigationTag
629+ navigationTag: scopeView.scope ? scopeView.scope.primaryNavigationTag : ""
630630 scopeStyle: scopeView.scopeStyle
631631 paginationCount: scopeView.paginationCount
632632 paginationIndex: scopeView.paginationIndex
@@ -669,6 +669,7 @@ FocusScope {
669669
670670 onDashNavigationLeafClicked: {
671671 categoryView.pageHeader.closePopup();
672+ categoryView.pageHeader.unfocus();
672673 }
673674 }
674675 }
tests/qmltests/Dash/tst_DashContent.qml+4−4
@@ -215,7 +215,7 @@ Item {
215215 verify(pageHeader, "Could not find the scope page header.");
216216 var innerHeader = findChild(pageHeader, "innerPageHeader");
217217 verify(innerHeader, "Could not find the scope page header.");
218− compare(innerHeader.config.title, scopesModel.getScope(data.index).name);
218+ compare(innerHeader.config.contents.text, scopesModel.getScope(data.index).name);
219219 }
220220
221221 function test_is_active_data() {
@@ -285,7 +285,7 @@ Item {
285285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
286286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
287287 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
288− var searchButton = findChild(dashContentList.currentItem, "search_header_button");
288+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
289289 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
290290 compare(peExtraPanel.visible, false);
291291 mouseClick(searchButton);
@@ -405,7 +405,7 @@ Item {
405405 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
406406 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
407407 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408− var searchButton = findChild(dashContentList.currentItem, "search_header_button");
408+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
409409 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410410 compare(peExtraPanel.visible, false);
411411 mouseClick(searchButton);
@@ -497,7 +497,7 @@ Item {
497497
498498 function test_clearSearchWithNavigationClosed() {
499499 var dashContentList = findChild(dashContent, "dashContentList");
500− var searchButton = findChild(dashContentList.currentItem, "search_header_button");
500+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
501501 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502502 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
503503
tests/qmltests/Dash/tst_GenericScopeView.qml+1−1
@@ -500,7 +500,7 @@ Item {
500500 mouseClick(seeAll0);
501501 verify(category0.expanded);
502502 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
503− tryCompare(genericScopeView.categoryView, "contentY", units.gu(9));
503+ tryCompare(genericScopeView.categoryView, "contentY", units.gu(8));
504504
505505 scrollToEnd();
506506
tests/qmltests/Dash/tst_PreviewListView.qml+1−1
@@ -91,7 +91,7 @@ Rectangle {
9191 var header = findChild(listView, "innerPageHeader");
9292 verify(header, "Could not find the preview header");
9393
94− compare(header.config.title, "Mock Scope");
94+ compare(header.config.contents.text, "Mock Scope");
9595 }
9696
9797 function test_header_style() {