on xenial help sign in
Modify Filter grid to rectangle.
32ef136Ying-Chun Liu
Dash/Generic/GenericFilterGrid.qml+3−3
@@ -24,11 +24,11 @@ FilterGrid {
24 filter: false
24 filter: false
25 minimumHorizontalSpacing: units.gu(0.5)
25 minimumHorizontalSpacing: units.gu(0.5)
26 delegateWidth: units.gu(11)
26 delegateWidth: units.gu(11)
27− delegateHeight: units.gu(18)
27+ delegateHeight: units.gu(9.5)
28 verticalSpacing: units.gu(2)
28 verticalSpacing: units.gu(2)
29
29
30− readonly property int iconWidth: (width / columns) * 0.8
30+ property int iconWidth: units.gu(8)
31− readonly property int iconHeight: iconWidth * 16 / 11
31+ property int iconHeight: units.gu(7.5)
32
32
33 signal clicked(int index, var delegateItem, real itemY)
33 signal clicked(int index, var delegateItem, real itemY)
34 signal pressAndHold(int index, var delegateItem, real itemY)
34 signal pressAndHold(int index, var delegateItem, real itemY)
Dash/Generic/GenericFilterGridPotrait.qmlnew file+30
@@ -0,0 +1,30 @@
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+
20+GenericFilterGrid {
21+ id: filtergrid
22+
23+ minimumHorizontalSpacing: units.gu(0.5)
24+ delegateWidth: units.gu(11)
25+ delegateHeight: units.gu(18)
26+ verticalSpacing: units.gu(2)
27+
28+ iconWidth: (width / columns) * 0.8
29+ iconHeight: iconWidth * 16 / 11
30+}
Dash/GenericScopeView.qml+8−3
@@ -64,7 +64,7 @@ ScopeView {
64 right: parent.right
64 right: parent.right
65 }
65 }
66
66
67− source: getRenderer(model.renderer)
67+ source: getRenderer(model.renderer, model.contentType)
68
68
69 onLoaded: {
69 onLoaded: {
70 item.model = results
70 item.model = results
@@ -114,9 +114,14 @@ ScopeView {
114 }
114 }
115 }
115 }
116
116
117− function getRenderer(rendererId) {
117+ function getRenderer(rendererId, contentType) {
118 switch (rendererId) {
118 switch (rendererId) {
119+ case "grid": {
120+ switch (contentType) {
121+ case "video": return "Generic/GenericFilterGridPotrait.qml"
119− case "grid": return "Generic/GenericFilterGrid.qml"
122+ default: return "Generic/GenericFilterGrid.qml"
123+ }
124+ }
120 case "carousel": return "Generic/GenericCarousel.qml"
125 case "carousel": return "Generic/GenericCarousel.qml"
121 default: return "Generic/GenericFilterGrid.qml"
126 default: return "Generic/GenericFilterGrid.qml"
122 }
127 }