on xenial help sign in
Merge apps_special_after_all
commit2ae26d952c808bcfb3069c375713d30d4007c9d9 authorAlbert Astals <albert.astals@canonical.com> dateFri 12 Dec 2014, 11:52 (12 years ago) parent18e9e80b06ae08
5 files changed+31−4
qml/Dash/GenericScopeView.qml+1−1 qml/Dash/ScopesListCategory.qml+2−2 qml/Dash/ScopesListCategoryItem.qml+3−1 tests/qmltests/Dash/tst_Dash.qml+24 tests/qmltests/Dash/tst_GenericScopeView.qml+1
qml/Dash/GenericScopeView.qml+1−1
@@ -494,7 +494,7 @@ FocusScope {
494494 showBackButton: scopeView.hasBackAction
495495 searchEntryEnabled: true
496496 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
497− favoriteEnabled: scopeView.scope
497+ favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
498498 favorite: scopeView.scope && scopeView.scope.favorite
499499 scopeStyle: scopeView.scopeStyle
500500 paginationCount: scopeView.paginationCount
qml/Dash/ScopesListCategory.qml+2−2
@@ -78,7 +78,7 @@ Item {
7878 clip: height < listItemHeight
7979 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
8080 sourceComponent: ScopesListCategoryItem {
81− objectName: "delegate" + index
81+ objectName: "delegate" + model.scopeId
8282
8383 width: root.width
8484 topMargin: height > listItemHeight ? height - listItemHeight : 0
@@ -86,7 +86,7 @@ Item {
8686 icon: model.art || model.mascot || ""
8787 text: model.title || ""
8888 subtext: model.subtitle || ""
89− showStar: root.isFavoritesFeed || root.isAlsoInstalled
89+ showStar: model.scopeId !== "clickscope" && (root.isFavoritesFeed || root.isAlsoInstalled)
9090 isFavorite: root.isFavoritesFeed
9191
9292 hideChildren: dragItem.loaderToShrink == loader
qml/Dash/ScopesListCategoryItem.qml+3−1
@@ -29,8 +29,8 @@ MouseArea {
2929 property alias icon: shapeImage.source
3030 property alias text: titleLabel.text
3131 property alias subtext: subtitleLabel.text
32− property alias showStar: star.visible
3332
33+ property bool showStar: false
3434 property bool isFavorite: false
3535 property bool hideChildren: false
3636
@@ -84,12 +84,14 @@ MouseArea {
8484 }
8585 MouseArea {
8686 id: starArea
87+ objectName: "starArea"
8788 height: parent.height
8889 width: height
8990 anchors.right: parent.right
9091 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
9192 onPressed: if (editMode) root.handlePressed(starArea);
9293 onReleased: if (editMode) root.handleReleased(starArea);
94+ visible: editMode || showStar
9395 Icon {
9496 id: star
9597 anchors.centerIn: parent
tests/qmltests/Dash/tst_Dash.qml+24
@@ -83,6 +83,30 @@ Item {
8383 return get_scope_data()
8484 }
8585
86+ function test_manage_dash_clickscope_unfavoritable() {
87+ // Show the manage dash
88+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
89+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
90+ tryCompare(bottomEdgeController, "progress", 1);
91+
92+ // Make sure stuff is loaded
93+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
94+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
95+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
96+
97+ // Click scope star area is not visible (i.e. can't be unfavorited)
98+ var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
99+ var starArea = findChild(clickScope, "starArea");
100+ compare(starArea.visible, false);
101+
102+ // Go back
103+ var scopesList = findChild(dash, "scopesList");
104+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
105+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
106+ mouseClick(backButton, 0, 0);
107+ tryCompare(bottomEdgeController, "progress", 0);
108+ }
109+
86110 function test_manage_dash_select_same_favorite() {
87111 // Show the manage dash
88112 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
tests/qmltests/Dash/tst_GenericScopeView.qml+1
@@ -574,6 +574,7 @@ Item {
574574 var innerHeader = findChild(header, "innerPageHeader");
575575 verify(innerHeader, "Could not find the inner header");
576576
577+ expectFail("Apps", "Click scope should not have a favorite button");
577578 var favoriteAction = findChild(innerHeader, "favorite_header_button");
578579 verify(favoriteAction, "Could not find the favorite action.");
579580 mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);