on xenial help sign in
Implement an 'interface' for Dash Renderers.

Approved by PS Jenkins bot, Michael Zanetti.

commite39cdcea05c454058d88639d74aed70ac0f07a62 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateSat 30 Nov 2013, 14:24 (13 years ago) parentb26ce73d5c06e2
16 files changed+246−168
Components/Carousel.qml+2−3 Components/FilterGrid.qml+3−2 Dash/DashCarousel.qml+47 Dash/DashFilterGrid.qml+60 Dash/DashRenderer.qml+65 Dash/Generic/GenericCarousel.qml+2−7 Dash/Generic/GenericCarouselLoader.qml−30 Dash/Generic/GenericFilterGrid.qml+13−19 Dash/Generic/GenericFilterGridPotrait.qml+1−3 Dash/GenericScopeView.qml+34−26 Dash/Music/MusicCarousel.qml+2−2 Dash/Music/MusicCarouselLoader.qml−24 Dash/Music/MusicFilterGrid.qml+7−13 Dash/Video/VideoCarousel.qml+2−2 Dash/Video/VideoCarouselLoader.qml−24 Dash/Video/VideoFilterGrid.qml+8−13
Components/Carousel.qml+2−3
@@ -63,6 +63,7 @@ Item {
6363 signal pressAndHold(int index, real itemY)
6464
6565 implicitHeight: listView.tileHeight * selectedItemScaleFactor
66+ opacity: listView.highlightIndex === -1 ? 1 : 0.6
6667
6768 /* Basic idea behind the carousel effect is to move the items of the delegates (compacting /stuffing them).
6869 One drawback is, that more delegates have to be drawn than usually. As some items are moved from the
@@ -75,11 +76,11 @@ Item {
7576 ListView {
7677 id: listView
7778
79+ property int highlightIndex: -1
7880 property real minimumTileWidth: 0
7981 property real newContentX: disabledNewContentX
8082 property real pathItemCount: referenceWidth / referenceTileWidth
8183 property real tileAspectRatio: 1
82− property int highlightIndex: -1
8384
8485 /* The positioning and scaling of the items in the carousel is based on the variable
8586 'continuousIndex', a continuous real variable between [0, 'carousel.model.count'],
@@ -293,7 +294,6 @@ Item {
293294 scale: itemScale * explicitScaleFactor
294295 sourceComponent: itemComponent
295296 z: cachedTiles - Math.abs(index - listView.selectedIndex)
296− opacity: highlightIndex == -1 ? 1 : (highlightIndex == index ? 0.6 : 0.2)
297297
298298 transform: Translate {
299299 x: xTransform
@@ -333,7 +333,6 @@ Item {
333333 onPressAndHold: {
334334 listView.itemPressAndHold(index, item)
335335 }
336−
337336 }
338337 }
339338 }
Components/FilterGrid.qml+3−2
@@ -41,11 +41,12 @@ Item {
4141
4242 /* Maximum number of rows to be show when filter=true. */
4343 property int collapsedRowCount: 2
44+ property int uncollapsedRowCount: Math.ceil(model.count / columns)
4445 readonly property int collapsedHeight: {
4546 return iconTileGrid.contentHeightForRows(Math.min(collapsedRowCount, Math.ceil(model.count / columns)))
4647 }
4748 readonly property int uncollapsedHeight: {
48− return iconTileGrid.contentHeightForRows(Math.ceil(model.count / columns))
49+ return iconTileGrid.contentHeightForRows(uncollapsedRowCount)
4950 }
5051
5152 property alias minimumHorizontalSpacing: iconTileGrid.minimumHorizontalSpacing
@@ -66,7 +67,7 @@ Item {
6667 property alias highlightIndex: iconTileGrid.highlightIndex
6768 readonly property alias currentItem: iconTileGrid.currentItem
6869
69− height: !filterAnimation.running ? childrenRect.height : height
70+ implicitHeight: !filterAnimation.running ? childrenRect.height : height
7071 clip: filterAnimation.running
7172
7273 NumberAnimation {
Dash/DashCarousel.qmlnew file+47
@@ -0,0 +1,47 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import "../Components"
20+
21+DashRenderer {
22+ id: dashCarousel
23+
24+ property alias cacheBuffer: carousel.cacheBuffer
25+ property alias itemComponent: carousel.itemComponent
26+ property alias minimumTileWidth: carousel.minimumTileWidth
27+ property alias selectedItemScaleFactor: carousel.selectedItemScaleFactor
28+ property alias tileAspectRatio: carousel.tileAspectRatio
29+
30+ currentItem: carousel.currentItem
31+ height: carousel.implicitHeight + units.gu(6)
32+ verticalSpacing: units.gu(3)
33+
34+ Carousel {
35+ id: carousel
36+ anchors.fill: parent
37+ tileAspectRatio: 198 / 288
38+ minimumTileWidth: units.gu(13)
39+ selectedItemScaleFactor: 1.14
40+ cacheBuffer: 1404 // 18px * 13gu * 6
41+ model: dashCarousel.model
42+ highlightIndex: dashCarousel.highlightIndex
43+
44+ onClicked: dashCarousel.clicked(index, itemY)
45+ onPressAndHold: dashCarousel.pressAndHold(index, itemY)
46+ }
47+}
Dash/DashFilterGrid.qmlnew file+60
@@ -0,0 +1,60 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import "../Components"
19+import ".."
20+
21+DashRenderer {
22+ id: dashFilterGrid
23+
24+ property alias cellWidth: filterGrid.cellWidth
25+ property alias cellHeight: filterGrid.cellHeight
26+ property alias delegate: filterGrid.delegate
27+ property alias delegateWidth: filterGrid.delegateWidth
28+ property alias delegateHeight: filterGrid.delegateHeight
29+ property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
30+ property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
31+
32+ collapsedHeight: filterGrid.collapsedHeight
33+ collapsedRowCount: filterGrid.collapsedRowCount
34+ columns: filterGrid.columns
35+ rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
36+ currentItem: filterGrid.currentItem
37+ expandable: filterGrid.expandable
38+ delegateCreationBegin: filterGrid.delegateCreationBegin
39+ delegateCreationEnd: filterGrid.delegateCreationEnd
40+ implicitHeight: filterGrid.implicitHeight
41+ margins: filterGrid.margins
42+ uncollapsedHeight: filterGrid.uncollapsedHeight
43+ verticalSpacing: filterGrid.verticalSpacing
44+
45+ function startFilterAnimation(filter) {
46+ filterGrid.startFilterAnimation(filter)
47+ }
48+
49+ FilterGrid {
50+ id: filterGrid
51+ anchors.fill: parent
52+ minimumHorizontalSpacing: units.gu(0.5)
53+ delegateWidth: units.gu(11)
54+ delegateHeight: units.gu(9.5)
55+ verticalSpacing: units.gu(2)
56+ model: dashFilterGrid.model
57+ filter: dashFilterGrid.filter
58+ highlightIndex: dashFilterGrid.highlightIndex
59+ }
60+}
Dash/DashRenderer.qmlnew file+65
@@ -0,0 +1,65 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+Item {
20+ // Can the item be expanded?
21+ property bool expandable: false
22+
23+ // In case it can be expanded, should we filter it
24+ property bool filter: true
25+
26+ property int collapsedRowCount: 1
27+
28+ property int collapsedHeight: height
29+
30+ property int columns: 1
31+
32+ property int rows: 1
33+
34+ // Index of the highlighted item
35+ property int highlightIndex: -1
36+
37+ property int margins: 0
38+
39+ property int uncollapsedHeight: height
40+
41+ property real delegateCreationBegin
42+
43+ property real delegateCreationEnd
44+
45+ property real verticalSpacing: 0
46+
47+ // The current item of the renderer
48+ property var currentItem
49+
50+ // The model to renderer
51+ property var model
52+
53+ /// Emitted when the user clicked on an item
54+ /// @param index is the index of the clicked item
55+ /// @param itemY is y of the clicked delegate
56+ signal clicked(int index, real itemY)
57+
58+ /// Emitted when the user pressed and held on an item
59+ /// @param index is the index of the held item
60+ /// @param itemY is y of the held delegate
61+ signal pressAndHold(int index, real itemY)
62+
63+ function startFilterAnimation(filter) {
64+ }
65+}
Dash/Generic/GenericCarousel.qml+2−7
@@ -17,16 +17,11 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import "../../Components"
20+import ".."
2021
21−Carousel {
22+DashCarousel {
2223 id: genericCarousel
23−
24− tileAspectRatio: 198 / 288
25− minimumTileWidth: units.gu(13)
2624 itemComponent: carouselDelegateGeneric
27− selectedItemScaleFactor: 1.14
28− cacheBuffer: 1404 // 18px * 13gu * 6
29− height: implicitHeight + units.gu(6)
3025
3126 Component {
3227 id: carouselDelegateGeneric
Dash/Generic/GenericCarouselLoader.qmldeleted−30
@@ -1,30 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−
20−Loader {
21− property var model: null
22− property url carouselUrl: "GenericCarousel.qml"
23− property url filtergridUrl: "GenericFilterGrid.qml"
24−
25− source: model.count > 6 ? carouselUrl : filtergridUrl // FIXME do not hardcode 6, but retrieve correct minimum required count
26−
27− onLoaded: {
28− item.model = Qt.binding(function() { return model; })
29− }
30−}
Dash/Generic/GenericFilterGrid.qml+13−19
@@ -15,38 +15,32 @@
1515 */
1616
1717import QtQuick 2.0
18+import Ubuntu.Components 0.1
1819import "../../Components"
20+import ".."
1921
20−FilterGrid {
21− id: filtergrid
22+DashFilterGrid {
23+ id: genericFilterGrid
24+
25+ property int iconWidth: units.gu(8)
26+ property int iconHeight: units.gu(7.5)
2227
2328 minimumHorizontalSpacing: units.gu(0.5)
2429 delegateWidth: units.gu(11)
2530 delegateHeight: units.gu(9.5)
2631 verticalSpacing: units.gu(2)
2732
28− property int iconWidth: units.gu(8)
29− property int iconHeight: units.gu(7.5)
30−
31− signal clicked(int index, real itemY)
32− signal pressAndHold(int index, real itemY)
33−
3433 delegate: Tile {
3534 id: tile
3635 objectName: "delegate" + index
37− width: filtergrid.cellWidth
38− height: filtergrid.cellHeight
36+ width: genericFilterGrid.cellWidth
37+ height: genericFilterGrid.cellHeight
3938 text: model.title
40− imageWidth: filtergrid.iconWidth
41− imageHeight: filtergrid.iconHeight
39+ imageWidth: genericFilterGrid.iconWidth
40+ imageHeight: genericFilterGrid.iconHeight
4241 source: model.icon
4342
44− onClicked: {
45− filtergrid.clicked(index, tile.y)
46− }
47−
48− onPressAndHold: {
49− filtergrid.pressAndHold(index, tile.y)
50− }
43+ onClicked: genericFilterGrid.clicked(index, tile.y)
44+ onPressAndHold: genericFilterGrid.pressAndHold(index, tile.y)
5145 }
5246}
Dash/Generic/GenericFilterGridPotrait.qml+1−3
@@ -15,16 +15,14 @@
1515 */
1616
1717import QtQuick 2.0
18+import Ubuntu.Components 0.1
1819import "../../Components"
1920
2021GenericFilterGrid {
21− id: filtergrid
22−
2322 minimumHorizontalSpacing: units.gu(0.5)
2423 delegateWidth: units.gu(11)
2524 delegateHeight: units.gu(18)
2625 verticalSpacing: units.gu(2)
27−
2826 iconWidth: (width / columns) * 0.8
2927 iconHeight: iconWidth * 16 / 11
3028}
Dash/GenericScopeView.qml+34−26
@@ -140,7 +140,7 @@ FocusScope {
140140 right: parent.right
141141 }
142142
143− source: getRenderer(model.renderer, model.contentType, model.rendererHint)
143+ source: getRenderer(model.renderer, model.contentType, model.rendererHint, results)
144144
145145 onLoaded: {
146146 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
@@ -191,8 +191,8 @@ FocusScope {
191191 } else {
192192 previewListView.open = true
193193
194− scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title,
195− item.comment, item.dndUri, item.metadata)
194+ scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
195+ item.comment, item.dndUri, item.metadata)
196196 }
197197 }
198198 onPressAndHold: {
@@ -205,7 +205,7 @@ FocusScope {
205205 previewListView.open = true
206206
207207 var item = target.model.get(index)
208− scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title,
208+ scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title,
209209 item.comment, item.dndUri, item.metadata)
210210 }
211211 }
@@ -303,16 +303,21 @@ FocusScope {
303303 }
304304 }
305305
306− function getRenderer(rendererId, contentType, rendererHint) {
306+ function getRenderer(rendererId, contentType, rendererHint, results) {
307307 if (rendererId == "default") {
308308 rendererId = getDefaultRendererId(contentType);
309309 }
310+ if (rendererId == "carousel") {
311+ // Selectively disable carousel, 6 is fixed for now, should change on the form factor
312+ if (results.count <= 6)
313+ rendererId = "grid"
314+ }
310315 switch (rendererId) {
311316 case "carousel": {
312317 switch (contentType) {
313− case "music": return "Music/MusicCarouselLoader.qml";
314− case "video": return "Video/VideoCarouselLoader.qml";
315− default: return "Generic/GenericCarouselLoader.qml";
318+ case "music": return "Music/MusicCarousel.qml";
319+ case "video": return "Video/VideoCarousel.qml";
320+ default: return "Generic/GenericCarousel.qml";
316321 }
317322 }
318323 case "grid": {
@@ -442,27 +447,30 @@ FocusScope {
442447 scopeView.scope.preview(item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
443448 }
444449
445− var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y;
450+ // Adjust contentY in case we need to change to it to show the next row
451+ if (categoryDelegate.rows > 1) {
452+ var itemY = categoryView.contentItem.mapFromItem(categoryDelegate.currentItem).y;
446453
447− // Find new contentY and effect.postionPx
448− var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing;
454+ // Find new contentY and effect.postionPx
455+ var newContentY = itemY - effect.positionPx - categoryDelegate.verticalSpacing;
449456
450− // Make sure the item is not covered by a header. Move the effect split down if necessary
451− var headerHeight = pageHeader.height + categoryView.stickyHeaderHeight;
452− var effectAdjust = Math.max(effect.positionPx, headerHeight);
457+ // Make sure the item is not covered by a header. Move the effect split down if necessary
458+ var headerHeight = pageHeader.height + categoryView.stickyHeaderHeight;
459+ var effectAdjust = Math.max(effect.positionPx, headerHeight);
453460
454− // Make sure we don't overscroll the listview. If yes, adjust effect position
455− if (newContentY < 0) {
456− effectAdjust += newContentY;
457− newContentY = 0;
458− }
459− if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
460− effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
461− newContentY = categoryView.contentHeight - categoryView.height;
462− }
461+ // Make sure we don't overscroll the listview. If yes, adjust effect position
462+ if (newContentY < 0) {
463+ effectAdjust += newContentY;
464+ newContentY = 0;
465+ }
466+ if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
467+ effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
468+ newContentY = categoryView.contentHeight - categoryView.height;
469+ }
463470
464− effect.positionPx = effectAdjust;
465− categoryView.contentY = newContentY;
471+ effect.positionPx = effectAdjust;
472+ categoryView.contentY = newContentY;
473+ }
466474 }
467475
468476 property bool open: false
@@ -540,7 +548,7 @@ FocusScope {
540548 }
541549
542550 function closePreviewSpinner() {
543− if(item) {
551+ if (item) {
544552 item.showProcessingAction = false;
545553 }
546554 }
Dash/Music/MusicCarousel.qml+2−2
@@ -16,15 +16,15 @@
1616
1717import QtQuick 2.0
1818import "../../Components"
19+import ".."
1920
20−Carousel {
21+DashCarousel {
2122 id: musicCarousel
2223 tileAspectRatio: 1
2324 minimumTileWidth: units.gu(13)
2425 itemComponent: carouselDelegateMusic
2526 selectedItemScaleFactor: 1.2
2627 cacheBuffer: 1404 // 18px * 13gu * 6
27− height: implicitHeight + units.gu(6)
2828
2929 Component {
3030 id: carouselDelegateMusic
Dash/Music/MusicCarouselLoader.qmldeleted−24
@@ -1,24 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import "../Generic"
20−
21−GenericCarouselLoader {
22− carouselUrl: "MusicCarousel.qml"
23− filtergridUrl: "MusicFilterGrid.qml"
24−}
Dash/Music/MusicFilterGrid.qml+7−13
@@ -19,22 +19,21 @@ import "../../Components"
1919import "../Generic"
2020
2121GenericFilterGrid {
22− id: filtergrid
22+ id: musicFilterGrid
2323
2424 delegateWidth: units.gu(11)
2525 delegateHeight: units.gu(16)
26−
2726 iconWidth: units.gu(11)
2827 iconHeight: units.gu(11)
2928
3029 delegate: Tile {
3130 id: tile
3231 objectName: "delegate" + index
33− width: filtergrid.cellWidth
34− height: filtergrid.cellHeight
32+ width: musicFilterGrid.cellWidth
33+ height: musicFilterGrid.cellHeight
3534 text: model.comment
36− imageWidth: filtergrid.iconWidth
37− imageHeight: filtergrid.iconHeight
35+ imageWidth: musicFilterGrid.iconWidth
36+ imageHeight: musicFilterGrid.iconHeight
3837 source: model.icon
3938 maximumLineCount: 2
4039 horizontalAlignment: Text.AlignLeft
@@ -43,12 +42,7 @@ GenericFilterGrid {
4342 artist: model.title
4443 }
4544
46− onClicked: {
47− filtergrid.clicked(index, tile.y)
48− }
49−
50− onPressAndHold: {
51− filtergrid.pressAndHold(index, tile.y)
52− }
45+ onClicked: musicFilterGrid.clicked(index, tile.y)
46+ onPressAndHold: musicFilterGrid.pressAndHold(index, tile.y)
5347 }
5448}
Dash/Video/VideoCarousel.qml+2−2
@@ -16,15 +16,15 @@
1616
1717import QtQuick 2.0
1818import "../../Components"
19+import ".."
1920
20−Carousel {
21+DashCarousel {
2122 id: videosCarousel
2223 tileAspectRatio: 198 / 288
2324 minimumTileWidth: units.gu(13)
2425 itemComponent: carouselDelegateVideo
2526 selectedItemScaleFactor: 1.14
2627 cacheBuffer: 1404 // 18px * 13gu * 6
27− height: implicitHeight + units.gu(6)
2828
2929 Component {
3030 id: carouselDelegateVideo
Dash/Video/VideoCarouselLoader.qmldeleted−24
@@ -1,24 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import "../Generic"
20−
21−GenericCarouselLoader {
22− carouselUrl: "VideoCarousel.qml"
23− filtergridUrl: "VideoFilterGrid.qml"
24−}
Dash/Video/VideoFilterGrid.qml+8−13
@@ -15,38 +15,33 @@
1515 */
1616
1717import QtQuick 2.0
18+import Ubuntu.Components 0.1
1819import "../../Components"
1920import "../Generic"
2021
2122GenericFilterGrid {
22− id: filtergrid
23+ id: videoFilterGrid
2324
2425 delegateWidth: units.gu(11)
2526 delegateHeight: units.gu(15)
26−
2727 iconWidth: units.gu(11)
2828 iconHeight: units.gu(11)
2929
3030 delegate: Tile {
3131 id: tile
3232 objectName: "delegate" + index
33− width: filtergrid.cellWidth
34− height: filtergrid.cellHeight
33+ width: videoFilterGrid.cellWidth
34+ height: videoFilterGrid.cellHeight
3535 text: model.title
36− imageWidth: filtergrid.iconWidth
37− imageHeight: filtergrid.iconHeight
36+ imageWidth: videoFilterGrid.iconWidth
37+ imageHeight: videoFilterGrid.iconHeight
3838 source: model.icon
3939 maximumLineCount: 2
4040 horizontalAlignment: Text.AlignLeft
4141
4242 style: VideoTileStyle {}
4343
44− onClicked: {
45− filtergrid.clicked(index, tile.y)
46− }
47−
48− onPressAndHold: {
49− filtergrid.pressAndHold(index, tile.y)
50− }
44+ onClicked: videoFilterGrid.clicked(index, tile.y)
45+ onPressAndHold: videoFilterGrid.pressAndHold(index, tile.y)
5146 }
5247}