Merge lp:~unity-team/unity8/new-scopes-fix-carousel5 into lp:~unity-team/unity8/new-scopes

Proposed by Michał Karnicki
Status: Merged
Approved by: Michał Sawicz
Approved revision: 584
Merged at revision: 584
Proposed branch: lp:~unity-team/unity8/new-scopes-fix-carousel5
Merge into: lp:~unity-team/unity8/new-scopes
Prerequisite: lp:~unity-team/unity8/unity8-fix-carousel5
Diff against target: 48 lines (+13/-13)
2 files modified
qml/Dash/GenericScopeView.qml (+2/-2)
tests/qmltests/Dash/tst_GenericScopeView.qml (+11/-11)
To merge this branch: bzr merge lp:~unity-team/unity8/new-scopes-fix-carousel5
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+203597@code.launchpad.net

Description of the change

Spec says:
"Minimum number of items in the carousel is 5."

Are there any related MPs required for this MP to build/function as expected?
 * No.
Did you perform an exploratory manual test run of your code change and any related functionality?
 * No, it only adds a test that covers old spec (<=6 fell back to grid layout)
If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 * No.
If you changed the UI, has there been a design review?
 * UI changes -- carousel minimum item count comes from the spec, so that was a Design team decision.

To post a comment you must log in.
584. By Michał Karnicki

Merge new-scopes.

Revision history for this message
Michał Sawicz (saviq) wrote :

Yup.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/GenericScopeView.qml'
2--- qml/Dash/GenericScopeView.qml 2014-01-29 13:46:57 +0000
3+++ qml/Dash/GenericScopeView.qml 2014-01-29 13:59:39 +0000
4@@ -321,8 +321,8 @@
5 var layout = template["category-layout"];
6
7 if (layout === "carousel") {
8- // TODO: Selectively disable carousel, 6 is fixed for now, should change depending on form factor
9- if (results.count <= 6) layout = "grid";
10+ // TODO: Selectively disable carousel, 4 is fixed for now, should change depending on form factor
11+ if (results.count <= 4) layout = "grid";
12 }
13 switch (layout) {
14 case "carousel": return "CardCarousel.qml";
15
16=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
17--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-01-28 11:16:19 +0000
18+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-01-29 13:59:39 +0000
19@@ -273,18 +273,18 @@
20 }
21
22 function test_getRendererCarouselGridFallback() {
23- var rendererId = "carousel"
24- var contentType = ""
25- var rendererHint = ""
26+ var template = new Object()
27+ template["category-layout"] = "carousel"
28 var results = new Object()
29-
30- results.count = 7
31- var renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
32- compare(renderer, "Generic/GenericCarousel.qml")
33-
34- results.count = 6
35- renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
36- compare(renderer, "Generic/GenericFilterGrid.qml")
37+ var renderer
38+
39+ results.count = 5
40+ renderer = genericScopeView.getRenderer(template, results)
41+ compare(renderer, "CardCarousel.qml")
42+
43+ results.count = 4
44+ renderer = genericScopeView.getRenderer(template, results)
45+ compare(renderer, "CardFilterGrid.qml")
46 }
47
48 function test_showPreviewCarousel() {

Subscribers

People subscribed via source and target branches

to all changes: