on xenial help sign in
Fix carousel grid fallback model size.
24d839bMichał Karnicki
qml/Dash/GenericScopeView.qml+2−2
@@ -325,8 +325,8 @@ FocusScope {
325 rendererId = getDefaultRendererId(contentType);
325 rendererId = getDefaultRendererId(contentType);
326 }
326 }
327 if (rendererId == "carousel") {
327 if (rendererId == "carousel") {
328− // Selectively disable carousel, 6 is fixed for now, should change on the form factor
328+ // Selectively disable carousel, 5 is fixed for now, should change on the form factor
329− if (results.count <= 6)
329+ if (results.count <= 5)
330 rendererId = "grid"
330 rendererId = "grid"
331 }
331 }
332 switch (rendererId) {
332 switch (rendererId) {
tests/qmltests/Dash/tst_GenericScopeView.qml+15
@@ -272,6 +272,21 @@ Item {
272 tryCompare(category, "filtered", true);
272 tryCompare(category, "filtered", true);
273 }
273 }
274
274
275+ function test_getRendererCarouselGridFallback() {
276+ var rendererId = "carousel"
277+ var contentType = ""
278+ var rendererHint = ""
279+ var results = new Object()
280+
281+ results.count = 6
282+ var renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
283+ compare(renderer, "Generic/GenericCarousel.qml")
284+
285+ results.count = 5
286+ var renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
287+ compare(renderer, "Generic/GenericFilterGrid.qml")
288+ }
289+
275 function test_showPreviewCarousel() {
290 function test_showPreviewCarousel() {
276 tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
291 tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
277 var tile = findChild(genericScopeView, "carouselDelegate");
292 var tile = findChild(genericScopeView, "carouselDelegate");