Merge lp:~saviq/unity8/dash-horizontal-list into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 1142
Merged at revision: 1153
Proposed branch: lp:~saviq/unity8/dash-horizontal-list
Merge into: lp:unity8
Diff against target: 128 lines (+71/-0)
4 files modified
qml/Dash/CardHorizontalList.qml (+62/-0)
qml/Dash/CardTool.qml (+2/-0)
qml/Dash/GenericScopeView.qml (+1/-0)
tests/qmltests/Dash/tst_CardTool.qml (+6/-0)
To merge this branch: bzr merge lp:~saviq/unity8/dash-horizontal-list
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Cimitan (community) Approve
Review via email: mp+230279@code.launchpad.net

Commit message

Add new horizontal list category layout.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.

 * Did you make sure that your branch does not contain spurious tags?
Yes.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Wayne (cwayne) wrote :

FWIW tried this out locally, seemed to do exactly what I expected (although it didn't have overview merged yet at the time)

Revision history for this message
Andrea Cimitan (cimi) wrote :

Few inline

review: Needs Fixing
1141. By Michał Sawicz

Merge trunk.

1142. By Michał Sawicz

Bump imports.

Revision history for this message
Michał Sawicz (saviq) :
Revision history for this message
Andrea Cimitan (cimi) :
review: Approve
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
yes
 * Did CI run pass? If not, please explain why.
Waiting CI

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'qml/Dash/CardHorizontalList.qml'
2--- qml/Dash/CardHorizontalList.qml 1970-01-01 00:00:00 +0000
3+++ qml/Dash/CardHorizontalList.qml 2014-08-13 15:33:58 +0000
4@@ -0,0 +1,62 @@
5+/*
6+ * Copyright (C) 2014 Canonical, Ltd.
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License as published by
10+ * the Free Software Foundation; version 3.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ */
20+
21+import QtQuick 2.2
22+import Ubuntu.Components 1.1
23+import "../Components"
24+
25+DashRenderer {
26+ id: root
27+
28+ expandedHeight: cardTool.cardHeight + units.gu(2)
29+ collapsedHeight: expandedHeight
30+ clip: true
31+
32+ ListView {
33+ id: listView
34+ anchors {
35+ fill: parent
36+ margins: units.gu(1)
37+ rightMargin: 0
38+ }
39+ rightMargin: units.gu(1)
40+ spacing: units.gu(1)
41+ model: root.model
42+ orientation: ListView.Horizontal
43+
44+ delegate: Loader {
45+ id: loader
46+ sourceComponent: cardTool.cardComponent
47+ anchors { top: parent.top; bottom: parent.bottom }
48+ width: cardTool.cardWidth
49+ onLoaded: {
50+ item.objectName = "delegate" + index;
51+ item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
52+ item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
53+ item.cardData = Qt.binding(function() { return model; });
54+ item.template = Qt.binding(function() { return cardTool.template; });
55+ item.components = Qt.binding(function() { return cardTool.components; });
56+ item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
57+ item.scopeStyle = root.scopeStyle;
58+ }
59+ Connections {
60+ target: loader.item
61+ onClicked: root.clicked(index, result)
62+ onPressAndHold: root.pressAndHold(index)
63+ }
64+ }
65+ }
66+}
67
68=== modified file 'qml/Dash/CardTool.qml'
69--- qml/Dash/CardTool.qml 2014-08-01 07:25:10 +0000
70+++ qml/Dash/CardTool.qml 2014-08-13 15:33:58 +0000
71@@ -91,6 +91,7 @@
72 }
73 return units.gu(18.5);
74 case "carousel":
75+ case "horizontal-list":
76 return carouselTool.minimumTileWidth;
77 case undefined:
78 case "organic-grid":
79@@ -111,6 +112,7 @@
80 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
81 return units.gu(18.5);
82 case "grid":
83+ case "horizontal-list":
84 return cardLoader.item ? cardLoader.item.implicitHeight : 0
85 case "carousel":
86 return cardWidth / (components ? components["art"]["aspect-ratio"] : 1)
87
88=== modified file 'qml/Dash/GenericScopeView.qml'
89--- qml/Dash/GenericScopeView.qml 2014-08-08 09:20:17 +0000
90+++ qml/Dash/GenericScopeView.qml 2014-08-13 15:33:58 +0000
91@@ -227,6 +227,7 @@
92 switch (cardTool.categoryLayout) {
93 case "carousel": return "CardCarousel.qml";
94 case "vertical-journal": return "CardVerticalJournal.qml";
95+ case "horizontal-list": return "CardHorizontalList.qml";
96 case "grid":
97 default: return "CardGrid.qml";
98 }
99
100=== modified file 'tests/qmltests/Dash/tst_CardTool.qml'
101--- tests/qmltests/Dash/tst_CardTool.qml 2014-05-02 14:51:22 +0000
102+++ tests/qmltests/Dash/tst_CardTool.qml 2014-08-13 15:33:58 +0000
103@@ -163,6 +163,7 @@
104 { label: "Horizontal Journal", layout: "journal" },
105 { label: "Vertical Journal", layout: "vertical-journal" },
106 { label: "Carousel", layout: "carousel" },
107+ { label: "Horizontal List", layout: "horizontal-list" },
108 ]
109 delegate: OptionSelectorDelegate { text: modelData.label }
110 onSelectedIndexChanged: {
111@@ -226,6 +227,7 @@
112 case "journal": layoutSelector.selectedIndex = 2; break;
113 case "vertical-journal": layoutSelector.selectedIndex = 3; break;
114 case "carousel": layoutSelector.selectedIndex = 4; break;
115+ case "horizontal-list": layoutSelector.selectedIndex = 5; break;
116 case "grid":
117 default: layoutSelector.selectedIndex = 0; break;
118 }
119@@ -270,6 +272,10 @@
120 { tag: "MediumCarousel", width: units.gu(22), height: units.gu(22), viewWidth: 84, index: 0, layout_index: 4},
121 { tag: "LargeCarousel", width: units.gu(26), height: units.gu(26), viewWidth: 140, index: 0, layout_index: 4},
122 { tag: "PortraitCarousel", width: units.gu(22), height: units.gu(44), viewWidth: 84, index: 10, layout_index: 4},
123+ { tag: "SmallHorizontalList", width: units.gu(18), height: units.gu(39.5), viewWidth: 30, index: 0, layout_index: 5},
124+ { tag: "MediumHorizontalList", width: units.gu(22), height: units.gu(43.5), viewWidth: 84, index: 0, layout_index: 5},
125+ { tag: "LargeHorizontalList", width: units.gu(26), height: units.gu(47.5), viewWidth: 140, index: 0, layout_index: 5},
126+ { tag: "PortraitHorizontalList", width: units.gu(22), height: units.gu(65.5), viewWidth: 84, index: 10, layout_index: 5},
127 ]
128 }
129

Subscribers

People subscribed via source and target branches