@@ -56,53 +56,45 @@ ScopeView {
5656 delegate: ListItems.Base {
5757 highlightWhenPressed: false
5858
59− FilterGrid {
60− id: filtergrid
61− model: results
62−
59+ Loader {
60+ id: rendererLoader
6361 anchors {
6462 top: parent.top
6563 left: parent.left
6664 right: parent.right
6765 }
6866
69− filter: false
70− minimumHorizontalSpacing: units.gu(0.5)
71− delegateWidth: units.gu(11)
72− delegateHeight: units.gu(18)
73− verticalSpacing: units.gu(2)
74−
75− delegate: Tile {
76− width: filtergrid.cellWidth
77− height: filtergrid.cellHeight
78− text: title
79− imageWidth: units.gu(11)
80− imageHeight: units.gu(16)
81−
82− source: IconUtil.from_gicon(icon)
83−
84− MouseArea {
85− anchors {
86− fill: parent
87− }
88− onClicked: {
89− mouse.accepted = true
90− effect.positionPx = mapToItem(categoryView, 0, 0).y
91− scopeView.scope.activate(uri, icon,
92− category, 0,
93− mimetype, title,
94− comment, dndUri,
95− metadata)
96− }
97− onPressAndHold: {
98− mouse.accepted = true
99− effect.positionPx = mapToItem(categoryView, 0, 0).y
100− scopeView.scope.preview(uri, icon,
101− category, 0,
102− mimetype, title,
103− comment, dndUri,
104− metadata)
105− }
67+ source: getRenderer(model.renderer, model.contentType)
68+
69+ onLoaded: {
70+ item.model = results
71+ }
72+
73+ Connections {
74+ target: rendererLoader.item
75+ onClicked: {
76+ effect.positionPx = mapToItem(categoryView, 0, itemY).y
77+ scopeView.scope.activate(delegateItem.model.uri,
78+ delegateItem.model.icon,
79+ delegateItem.model.category,
80+ 0,
81+ delegateItem.model.mimetype,
82+ delegateItem.model.title,
83+ delegateItem.model.comment,
84+ delegateItem.model.dndUri,
85+ delegateItem.model.metadata)
86+ }
87+ onPressAndHold: {
88+ effect.positionPx = mapToItem(categoryView, 0, itemY).y
89+ scopeView.scope.preview( delegateItem.model.uri,
90+ delegateItem.model.icon,
91+ delegateItem.model.category,
92+ 0,
93+ delegateItem.model.mimetype,
94+ delegateItem.model.title,
95+ delegateItem.model.comment,
96+ delegateItem.model.dndUri,
97+ delegateItem.model.metadata)
10698 }
10799 }
108100 }
@@ -122,6 +114,19 @@ ScopeView {
122114 }
123115 }
124116
117+ function getRenderer(rendererId, contentType) {
118+ switch (rendererId) {
119+ case "grid": {
120+ switch (contentType) {
121+ case "video": return "Generic/GenericFilterGridPotrait.qml";
122+ default: return "Generic/GenericFilterGrid.qml";
123+ }
124+ }
125+ case "carousel": return "Generic/GenericCarousel.qml";
126+ default: return "Generic/GenericFilterGrid.qml";
127+ }
128+ }
129+
125130 OpenEffect {
126131 id: effect
127132 anchors {