on xenial help sign in
test click scope is not favoritable
97ca86bAlbert Astals
qml/Dash/ScopesListCategory.qml+1−1
@@ -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
qml/Dash/ScopesListCategoryItem.qml+2−1
@@ -84,18 +84,19 @@ 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: !hideChildren && (editMode || showStar)
93 Icon {
95 Icon {
94 id: star
96 id: star
95 anchors.centerIn: parent
97 anchors.centerIn: parent
96 height: units.gu(2)
98 height: units.gu(2)
97 width: units.gu(2)
99 width: units.gu(2)
98− visible: !hideChildren && (editMode || showStar)
99 // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
100 // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
100 source: editMode ? "image://theme/view-grid-symbolic" : isFavorite ? "image://theme/starred" : "image://theme/non-starred"
101 source: editMode ? "image://theme/view-grid-symbolic" : isFavorite ? "image://theme/starred" : "image://theme/non-starred"
101 }
102 }
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));