on xenial help sign in
Modify Filter grid to rectangle.

Add Potrait filter grid for videos.

commit32ef136e2d2f4ccbefd0107fe5861c81bf1bb147 authorYing-Chun Liu <paul.liu@canonical.com> dateTue 16 Jul 2013, 22:51 (13 years ago) parentd6b88d2
3 files changed+41−6
Dash/Generic/GenericFilterGrid.qml+3−3 Dash/Generic/GenericFilterGridPotrait.qml+30 Dash/GenericScopeView.qml+8−3
Dash/Generic/GenericFilterGrid.qml+3−3
@@ -24,11 +24,11 @@ FilterGrid {
2424 filter: false
2525 minimumHorizontalSpacing: units.gu(0.5)
2626 delegateWidth: units.gu(11)
27− delegateHeight: units.gu(18)
27+ delegateHeight: units.gu(9.5)
2828 verticalSpacing: units.gu(2)
2929
30− readonly property int iconWidth: (width / columns) * 0.8
31− readonly property int iconHeight: iconWidth * 16 / 11
30+ property int iconWidth: units.gu(8)
31+ property int iconHeight: units.gu(7.5)
3232
3333 signal clicked(int index, var delegateItem, real itemY)
3434 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 {
6464 right: parent.right
6565 }
6666
67− source: getRenderer(model.renderer)
67+ source: getRenderer(model.renderer, model.contentType)
6868
6969 onLoaded: {
7070 item.model = results
@@ -114,9 +114,14 @@ ScopeView {
114114 }
115115 }
116116
117− function getRenderer(rendererId) {
117+ function getRenderer(rendererId, contentType) {
118118 switch (rendererId) {
119− case "grid": return "Generic/GenericFilterGrid.qml"
119+ case "grid": {
120+ switch (contentType) {
121+ case "video": return "Generic/GenericFilterGridPotrait.qml"
122+ default: return "Generic/GenericFilterGrid.qml"
123+ }
124+ }
120125 case "carousel": return "Generic/GenericCarousel.qml"
121126 default: return "Generic/GenericFilterGrid.qml"
122127 }