@@ -28,14 +28,6 @@ import "../Components"
2828Item {
2929 id: root
3030
31− QtObject {
32− id: d
33− /* If true, the number of elements displayed will be limited by collapsedRowCount.
34− If false, all elements will be displayed, effectively looking the same as a regular
35− ResponsiveGridView. Manipulate this property through setFilter */
36− property bool filter: true
37− }
38−
3931 /* Whether, when collapsed, a button should be displayed enabling the user to expand
4032 the grid to its full size. */
4133 readonly property bool expandable: model.count > rowsWhenCollapsed * iconTileGrid.columns
@@ -68,8 +60,9 @@ Item {
6860 readonly property alias pressDelay: iconTileGrid.pressDelay
6961 property alias highlightIndex: iconTileGrid.highlightIndex
7062 readonly property alias currentItem: iconTileGrid.currentItem
63+ readonly property alias filtered: limitModel.filter
7164
72− height: d.filter ? root.collapsedHeight : root.uncollapsedHeight
65+ height: d.collapsed ? root.collapsedHeight : root.uncollapsedHeight
7366 clip: filterAnimation.running
7467
7568 Behavior on height {
@@ -84,16 +77,21 @@ Item {
8477 easing.type: Easing.InOutQuad
8578 onRunningChanged: {
8679 if (!running) {
87− limitModel.filter = d.filter;
80+ limitModel.filter = d.collapsed;
8881 }
8982 heightBehaviour.enabled = false;
9083 }
9184 }
9285 }
9386
87+ QtObject {
88+ id: d
89+ property bool collapsed: true
90+ }
91+
9492 function setFilter(filter, animate) {
9593 heightBehaviour.enabled = animate;
96− d.filter = filter;
94+ d.collapsed = filter;
9795 if (!animate || !filter) {
9896 limitModel.filter = filter;
9997 }
@@ -114,11 +112,10 @@ Item {
114112
115113 model: LimitProxyModel {
116114 id: limitModel
117− // We do have another filter property here because
118− // we can't directly use filter from the root since we need to decouple
115+ // We do have filter and collapsed propertis because we need to decouple
119116 // the real filtering with the animation since the closing animation
120− // i.e. filter=false we still need to not be filtering until
121− // t he animation finishes otherwise we hide the items when the animation
117+ // i.e. setFilter(false. true) we still need to not be filtering until
118+ // the animation finishes otherwise we hide the items when the animation
122119 // is still running
123120 property bool filter: true
124121 model: root.model