on xenial help sign in
clickscope is back to being unfavoritable Fixes: #1400762
112b015Albert Astals
qml/Dash/GenericScopeView.qml+1−1
@@ -520,7 +520,7 @@ FocusScope {
520 showBackButton: scopeView.hasBackAction
520 showBackButton: scopeView.hasBackAction
521 searchEntryEnabled: true
521 searchEntryEnabled: true
522 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
522 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
523− favoriteEnabled: scopeView.scope
523+ favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
524 favorite: scopeView.scope && scopeView.scope.favorite
524 favorite: scopeView.scope && scopeView.scope.favorite
525 scopeStyle: scopeView.scopeStyle
525 scopeStyle: scopeView.scopeStyle
526 paginationCount: scopeView.paginationCount
526 paginationCount: scopeView.paginationCount
qml/Dash/ScopesListCategory.qml+2−2
@@ -78,7 +78,7 @@ Item {
78 clip: height < listItemHeight
78 clip: height < listItemHeight
79 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
79 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
80 sourceComponent: ScopesListCategoryItem {
80 sourceComponent: ScopesListCategoryItem {
81− objectName: "delegate" + index
81+ objectName: "delegate" + model.scopeId
82
82
83 width: root.width
83 width: root.width
84 topMargin: height > listItemHeight ? height - listItemHeight : 0
84 topMargin: height > listItemHeight ? height - listItemHeight : 0
@@ -86,7 +86,7 @@ Item {
86 icon: model.art || model.mascot || ""
86 icon: model.art || model.mascot || ""
87 text: model.title || ""
87 text: model.title || ""
88 subtext: model.subtitle || ""
88 subtext: model.subtitle || ""
89− showStar: root.isFavoritesFeed || root.isAlsoInstalled
89+ showStar: model.scopeId !== "clickscope" && (root.isFavoritesFeed || root.isAlsoInstalled)
90 isFavorite: root.isFavoritesFeed
90 isFavorite: root.isFavoritesFeed
91
91
92 hideChildren: dragItem.loaderToShrink == loader
92 hideChildren: dragItem.loaderToShrink == loader
qml/Dash/ScopesListCategoryItem.qml+3−1
@@ -29,8 +29,8 @@ MouseArea {
29 property alias icon: shapeImage.source
29 property alias icon: shapeImage.source
30 property alias text: titleLabel.text
30 property alias text: titleLabel.text
31 property alias subtext: subtitleLabel.text
31 property alias subtext: subtitleLabel.text
32− property alias showStar: star.visible
33
32
33+ property bool showStar: false
34 property bool isFavorite: false
34 property bool isFavorite: false
35 property bool hideChildren: false
35 property bool hideChildren: false
36
36
@@ -84,12 +84,14 @@ MouseArea {
84 }
84 }
85 MouseArea {
85 MouseArea {
86 id: starArea
86 id: starArea
87+ objectName: "starArea"
87 height: parent.height
88 height: parent.height
88 width: height
89 width: height
89 anchors.right: parent.right
90 anchors.right: parent.right
90 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
91 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
91 onPressed: if (editMode) root.handlePressed(starArea);
92 onPressed: if (editMode) root.handlePressed(starArea);
92 onReleased: if (editMode) root.handleReleased(starArea);
93 onReleased: if (editMode) root.handleReleased(starArea);
94+ visible: editMode || showStar
93 Icon {
95 Icon {
94 id: star
96 id: star
95 anchors.centerIn: parent
97 anchors.centerIn: parent
tests/qmltests/Dash/tst_Dash.qml+24
@@ -83,6 +83,30 @@ Item {
83 return get_scope_data()
83 return get_scope_data()
84 }
84 }
85
85
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+
86 function test_manage_dash_select_same_favorite() {
110 function test_manage_dash_select_same_favorite() {
87 // Show the manage dash
111 // Show the manage dash
88 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
112 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
tests/qmltests/Dash/tst_GenericScopeView.qml+1
@@ -575,6 +575,7 @@ Item {
575 var innerHeader = findChild(header, "innerPageHeader");
575 var innerHeader = findChild(header, "innerPageHeader");
576 verify(innerHeader, "Could not find the inner header");
576 verify(innerHeader, "Could not find the inner header");
577
577
578+ expectFail("Apps", "Click scope should not have a favorite button");
578 var favoriteAction = findChild(innerHeader, "favorite_header_button");
579 var favoriteAction = findChild(innerHeader, "favorite_header_button");
579 verify(favoriteAction, "Could not find the favorite action.");
580 verify(favoriteAction, "Could not find the favorite action.");
580 mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);
581 mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);