on xenial help sign in
Move to work on GenericScopeView.qml
203cf69Albert Astals
Components/Tile.qml−6
@@ -84,10 +84,4 @@ AbstractButton {
84 horizontalAlignment: Text.AlignHCenter
84 horizontalAlignment: Text.AlignHCenter
85 }
85 }
86 }
86 }
87−
88− GridView.onRemove: SequentialAnimation {
89− PropertyAction { target: root; property: "GridView.delayRemove"; value: true }
90− NumberAnimation { target: root; property: "opacity"; from: 1; to: 0; duration: 200; easing.type: Easing.InOutQuad }
91− PropertyAction { target: root; property: "GridView.delayRemove"; value: false }
92− }
93}
87}
Dash/Apps/ApplicationsFilterGrid.qml+1
@@ -22,6 +22,7 @@ import "../../Components/IconUtil.js" as IconUtil
22FilterGrid {
22FilterGrid {
23 id: filterGrid
23 id: filterGrid
24
24
25+ filter: false
25 minimumHorizontalSpacing: units.gu(0.5)
26 minimumHorizontalSpacing: units.gu(0.5)
26 maximumNumberOfColumns: 6
27 maximumNumberOfColumns: 6
27 delegateWidth: units.gu(11)
28 delegateWidth: units.gu(11)
Dash/DashApps.qml+13−14
@@ -117,13 +117,8 @@ ScopeView {
117 delegate: Base {
117 delegate: Base {
118 id: container
118 id: container
119 highlightWhenPressed: false
119 highlightWhenPressed: false
120− property var loader: loader
121− // Needed because of the GridView.onRemove anim in Tile.qml
122− // TODO see how can we do away without the clip (i.e. not run the animation if we are collapsing)
123− clip: true
124
120
125 Loader {
121 Loader {
126− id: loader
127 anchors {
122 anchors {
128 top: parent.top
123 top: parent.top
129 left: parent.left
124 left: parent.left
@@ -143,24 +138,28 @@ ScopeView {
143
138
144 item.model = Qt.binding(function() { return categoryModels[modelName]; });
139 item.model = Qt.binding(function() { return categoryModels[modelName]; });
145 item.clicked.connect(activateApplication);
140 item.clicked.connect(activateApplication);
146−
147 }
141 }
148 }
142 }
149 }
143 }
144+
145+ ListView.onRemove: SequentialAnimation {
146+ PropertyAction {
147+ target: container; property: "ListView.delayRemove"; value: true
148+ }
149+ NumberAnimation {
150+ target: container; property: "height"; to: 0;
151+ duration: 250; easing.type: Easing.InOutQuad
152+ }
153+ PropertyAction {
154+ target: container; property: "ListView.delayRemove"; value: false
155+ }
156+ }
150 }
157 }
151
158
152 sectionProperty: "category"
159 sectionProperty: "category"
153 sectionDelegate: Header {
160 sectionDelegate: Header {
154 width: categoryView.width
161 width: categoryView.width
155 text: categoryListModel.getCategory(section)
162 text: categoryListModel.getCategory(section)
156− onClicked: {
157− var obj = categoryView.item(delegateIndex)
158− if (obj && obj.loader.item.expandable) {
159− obj.loader.item.filter = !obj.loader.item.filter
160− if (!obj.loader.item.filter)
161− categoryView.maximizeVisibleArea(delegateIndex);
162− }
163− }
164 }
163 }
165 pageHeader: PageHeader {
164 pageHeader: PageHeader {
166 id: pageHeader
165 id: pageHeader
Dash/Generic/GenericFilterGrid.qml−1
@@ -21,7 +21,6 @@ import "../../Components/IconUtil.js" as IconUtil
21FilterGrid {
21FilterGrid {
22 id: filtergrid
22 id: filtergrid
23
23
24− filter: false
25 minimumHorizontalSpacing: units.gu(0.5)
24 minimumHorizontalSpacing: units.gu(0.5)
26 delegateWidth: units.gu(11)
25 delegateWidth: units.gu(11)
27 delegateHeight: units.gu(9.5)
26 delegateHeight: units.gu(9.5)
Dash/GenericScopeView.qml+15
@@ -56,6 +56,12 @@ ScopeView {
56 delegate: ListItems.Base {
56 delegate: ListItems.Base {
57 highlightWhenPressed: false
57 highlightWhenPressed: false
58
58
59+ function headerClicked() {
60+ if (rendererLoader.item.expandable) {
61+ rendererLoader.item.filter = !rendererLoader.item.filter;
62+ }
63+ }
64+
59 Loader {
65 Loader {
60 id: rendererLoader
66 id: rendererLoader
61 anchors {
67 anchors {
@@ -96,6 +102,10 @@ ScopeView {
96 delegateItem.model.dndUri,
102 delegateItem.model.dndUri,
97 delegateItem.model.metadata)
103 delegateItem.model.metadata)
98 }
104 }
105+ onFilterChanged: {
106+ if (!target.filter)
107+ categoryView.maximizeVisibleArea(index);
108+ }
99 }
109 }
100 }
110 }
101 }
111 }
@@ -104,6 +114,11 @@ ScopeView {
104 sectionDelegate: ListItems.Header {
114 sectionDelegate: ListItems.Header {
105 width: categoryView.width
115 width: categoryView.width
106 text: section
116 text: section
117+ onClicked: {
118+ var obj = categoryView.item(delegateIndex);
119+ if (obj)
120+ obj.headerClicked();
121+ }
107 }
122 }
108 pageHeader: PageHeader {
123 pageHeader: PageHeader {
109 id: pageHeader
124 id: pageHeader