@@ -15,35 +15,62 @@
1515 */
1616
1717import QtQuick 2.0
18−import Ubuntu.Components 0.1
18+import "../Components"
1919
20−DashFilterGrid {
20+DashRenderer {
2121 id: genericFilterGrid
2222
23− minimumHorizontalSpacing: units.gu(1)
24− delegateWidth: cardTool.cardWidth
25− delegateHeight: cardTool.cardHeight
26− verticalSpacing: units.gu(1)
23+ expandable: filterGrid.expandable
2724 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
25+ collapsedHeight: filterGrid.collapsedHeight
26+ columns: filterGrid.columns
27+ rows: filter ? collapsedRowCount : uncollapsedRowCount
28+ margins: filterGrid.margins
29+ uncollapsedHeight: filterGrid.uncollapsedHeight
30+ verticalSpacing: units.gu(1)
31+ currentItem: filterGrid.currentItem
32+ height: filterGrid.height
33+
34+ function startFilterAnimation(filter) {
35+ filterGrid.startFilterAnimation(filter)
36+ }
37+
38+ FilterGrid {
39+ id: filterGrid
40+ width: genericFilterGrid.width
41+ minimumHorizontalSpacing: units.gu(1)
42+ delegateWidth: cardTool.cardWidth
43+ delegateHeight: cardTool.cardHeight
44+ verticalSpacing: genericFilterGrid.verticalSpacing
45+ model: genericFilterGrid.model
46+ filter: genericFilterGrid.filter
47+ collapsedRowCount: genericFilterGrid.collapsedRowCount
48+ delegateCreationBegin: genericFilterGrid.delegateCreationBegin
49+ delegateCreationEnd: genericFilterGrid.delegateCreationEnd
50+ delegate: Item {
51+ width: filterGrid.cellWidth
52+ height: filterGrid.cellHeight
53+ Card {
54+ id: card
55+ width: cardTool.cardWidth
56+ height: cardTool.cardHeight
57+ headerHeight: cardTool.headerHeight
58+ anchors.horizontalCenter: parent.horizontalCenter
59+ objectName: "delegate" + index
60+ cardData: model
61+ template: cardTool.template
62+ components: cardTool.components
63+
64+ headerAlignment: cardTool.headerAlignment
65+
66+ onClicked: genericFilterGrid.clicked(index, card.y)
67+ onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
68+ }
69+ }
2870
29− delegate: Item {
30− width: genericFilterGrid.cellWidth
31− height: genericFilterGrid.cellHeight
32− Card {
33− id: card
34− width: cardTool.cardWidth
35− height: cardTool.cardHeight
36− headerHeight: cardTool.headerHeight
37− anchors.horizontalCenter: parent.horizontalCenter
38− objectName: "delegate" + index
39− cardData: model
40− template: cardTool.template
41− components: cardTool.components
42−
43− headerAlignment: cardTool.headerAlignment
44−
45− onClicked: genericFilterGrid.clicked(index, card.y)
46− onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
71+ onFilterChanged: {
72+ genericFilterGrid.filter = filter
73+ filter = Qt.binding(function() { return genericFilterGrid.filter })
4774 }
4875 }
4976}