on xenial help sign in
Fix collapsing of categories not working
7333f3dAlbert Astals
Dash/DashFilterGrid.qml+4
@@ -56,5 +56,9 @@ DashRenderer {
56 model: dashFilterGrid.model
56 model: dashFilterGrid.model
57 filter: dashFilterGrid.filter
57 filter: dashFilterGrid.filter
58 highlightIndex: dashFilterGrid.highlightIndex
58 highlightIndex: dashFilterGrid.highlightIndex
59+
60+ onFilterChanged: {
61+ dashFilterGrid.filter = filter
62+ }
59 }
63 }
60}
64}
Dash/GenericScopeView.qml+2
@@ -126,6 +126,7 @@ FocusScope {
126
126
127 delegate: ListItems.Base {
127 delegate: ListItems.Base {
128 id: baseItem
128 id: baseItem
129+ objectName: "dashCategory" + category
129 highlightWhenPressed: false
130 highlightWhenPressed: false
130
131
131 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
132 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
@@ -271,6 +272,7 @@ FocusScope {
271
272
272 sectionProperty: "name"
273 sectionProperty: "name"
273 sectionDelegate: ListItems.Header {
274 sectionDelegate: ListItems.Header {
275+ objectName: "dashSectionHeader" + delegate.category
274 property var delegate: categoryView.item(delegateIndex)
276 property var delegate: categoryView.item(delegateIndex)
275 width: categoryView.width
277 width: categoryView.width
276 text: section
278 text: section
tests/qmltests/Dash/tst_GenericScopeView.qml+20
@@ -222,6 +222,26 @@ Item {
222 genericScopeView.scope = scopes.get(0)
222 genericScopeView.scope = scopes.get(0)
223 tryCompare(genericScopeView.scope, "searchQuery", "")
223 tryCompare(genericScopeView.scope, "searchQuery", "")
224 }
224 }
225+
226+ function test_filter_expand_collapse() {
227+ // wait for the item to be there
228+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != undefined; }, true);
229+
230+ var header = findChild(genericScopeView, "dashSectionHeader0")
231+ var category = findChild(genericScopeView, "dashCategory0")
232+
233+ waitForRendering(header);
234+ verify(category.expandable);
235+ verify(category.filtered);
236+
237+ mouseClick(header, header.width / 2, header.height / 2);
238+ verify(category.expandable);
239+ tryCompare(category, "filtered", false);
240+
241+ mouseClick(header, header.width / 2, header.height / 2);
242+ verify(category.expandable);
243+ tryCompare(category, "filtered", true);
244+ }
225 }
245 }
226 }
246 }
227}
247}