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
=== added file 'qml/Dash/CardHorizontalList.qml'
--- qml/Dash/CardHorizontalList.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/CardHorizontalList.qml 2014-08-13 15:33:58 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright (C) 2014 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
17import QtQuick 2.2
18import Ubuntu.Components 1.1
19import "../Components"
20
21DashRenderer {
22 id: root
23
24 expandedHeight: cardTool.cardHeight + units.gu(2)
25 collapsedHeight: expandedHeight
26 clip: true
27
28 ListView {
29 id: listView
30 anchors {
31 fill: parent
32 margins: units.gu(1)
33 rightMargin: 0
34 }
35 rightMargin: units.gu(1)
36 spacing: units.gu(1)
37 model: root.model
38 orientation: ListView.Horizontal
39
40 delegate: Loader {
41 id: loader
42 sourceComponent: cardTool.cardComponent
43 anchors { top: parent.top; bottom: parent.bottom }
44 width: cardTool.cardWidth
45 onLoaded: {
46 item.objectName = "delegate" + index;
47 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
48 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
49 item.cardData = Qt.binding(function() { return model; });
50 item.template = Qt.binding(function() { return cardTool.template; });
51 item.components = Qt.binding(function() { return cardTool.components; });
52 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
53 item.scopeStyle = root.scopeStyle;
54 }
55 Connections {
56 target: loader.item
57 onClicked: root.clicked(index, result)
58 onPressAndHold: root.pressAndHold(index)
59 }
60 }
61 }
62}
063
=== modified file 'qml/Dash/CardTool.qml'
--- qml/Dash/CardTool.qml 2014-08-01 07:25:10 +0000
+++ qml/Dash/CardTool.qml 2014-08-13 15:33:58 +0000
@@ -91,6 +91,7 @@
91 }91 }
92 return units.gu(18.5);92 return units.gu(18.5);
93 case "carousel":93 case "carousel":
94 case "horizontal-list":
94 return carouselTool.minimumTileWidth;95 return carouselTool.minimumTileWidth;
95 case undefined:96 case undefined:
96 case "organic-grid":97 case "organic-grid":
@@ -111,6 +112,7 @@
111 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);112 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
112 return units.gu(18.5);113 return units.gu(18.5);
113 case "grid":114 case "grid":
115 case "horizontal-list":
114 return cardLoader.item ? cardLoader.item.implicitHeight : 0116 return cardLoader.item ? cardLoader.item.implicitHeight : 0
115 case "carousel":117 case "carousel":
116 return cardWidth / (components ? components["art"]["aspect-ratio"] : 1)118 return cardWidth / (components ? components["art"]["aspect-ratio"] : 1)
117119
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2014-08-08 09:20:17 +0000
+++ qml/Dash/GenericScopeView.qml 2014-08-13 15:33:58 +0000
@@ -227,6 +227,7 @@
227 switch (cardTool.categoryLayout) {227 switch (cardTool.categoryLayout) {
228 case "carousel": return "CardCarousel.qml";228 case "carousel": return "CardCarousel.qml";
229 case "vertical-journal": return "CardVerticalJournal.qml";229 case "vertical-journal": return "CardVerticalJournal.qml";
230 case "horizontal-list": return "CardHorizontalList.qml";
230 case "grid":231 case "grid":
231 default: return "CardGrid.qml";232 default: return "CardGrid.qml";
232 }233 }
233234
=== modified file 'tests/qmltests/Dash/tst_CardTool.qml'
--- tests/qmltests/Dash/tst_CardTool.qml 2014-05-02 14:51:22 +0000
+++ tests/qmltests/Dash/tst_CardTool.qml 2014-08-13 15:33:58 +0000
@@ -163,6 +163,7 @@
163 { label: "Horizontal Journal", layout: "journal" },163 { label: "Horizontal Journal", layout: "journal" },
164 { label: "Vertical Journal", layout: "vertical-journal" },164 { label: "Vertical Journal", layout: "vertical-journal" },
165 { label: "Carousel", layout: "carousel" },165 { label: "Carousel", layout: "carousel" },
166 { label: "Horizontal List", layout: "horizontal-list" },
166 ]167 ]
167 delegate: OptionSelectorDelegate { text: modelData.label }168 delegate: OptionSelectorDelegate { text: modelData.label }
168 onSelectedIndexChanged: {169 onSelectedIndexChanged: {
@@ -226,6 +227,7 @@
226 case "journal": layoutSelector.selectedIndex = 2; break;227 case "journal": layoutSelector.selectedIndex = 2; break;
227 case "vertical-journal": layoutSelector.selectedIndex = 3; break;228 case "vertical-journal": layoutSelector.selectedIndex = 3; break;
228 case "carousel": layoutSelector.selectedIndex = 4; break;229 case "carousel": layoutSelector.selectedIndex = 4; break;
230 case "horizontal-list": layoutSelector.selectedIndex = 5; break;
229 case "grid":231 case "grid":
230 default: layoutSelector.selectedIndex = 0; break;232 default: layoutSelector.selectedIndex = 0; break;
231 }233 }
@@ -270,6 +272,10 @@
270 { tag: "MediumCarousel", width: units.gu(22), height: units.gu(22), viewWidth: 84, index: 0, layout_index: 4},272 { tag: "MediumCarousel", width: units.gu(22), height: units.gu(22), viewWidth: 84, index: 0, layout_index: 4},
271 { tag: "LargeCarousel", width: units.gu(26), height: units.gu(26), viewWidth: 140, index: 0, layout_index: 4},273 { tag: "LargeCarousel", width: units.gu(26), height: units.gu(26), viewWidth: 140, index: 0, layout_index: 4},
272 { tag: "PortraitCarousel", width: units.gu(22), height: units.gu(44), viewWidth: 84, index: 10, layout_index: 4},274 { tag: "PortraitCarousel", width: units.gu(22), height: units.gu(44), viewWidth: 84, index: 10, layout_index: 4},
275 { tag: "SmallHorizontalList", width: units.gu(18), height: units.gu(39.5), viewWidth: 30, index: 0, layout_index: 5},
276 { tag: "MediumHorizontalList", width: units.gu(22), height: units.gu(43.5), viewWidth: 84, index: 0, layout_index: 5},
277 { tag: "LargeHorizontalList", width: units.gu(26), height: units.gu(47.5), viewWidth: 140, index: 0, layout_index: 5},
278 { tag: "PortraitHorizontalList", width: units.gu(22), height: units.gu(65.5), viewWidth: 84, index: 10, layout_index: 5},
273 ]279 ]
274 }280 }
275281

Subscribers

People subscribed via source and target branches