on xenial help sign in
Background needs to be specified to be visible in horizontal cards Fixes: #1411748

Approved by: Albert Astals Cid

commitddb61a398f55d7e04bb2b18ebfb4cb930b48e0a4 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 5 Feb 2015, 10:29 (12 years ago) parent266b7ec326b96a
2 files changed+9−2
plugins/Dash/CardCreator.js+2−1 tests/qmltests/Dash/tst_Card.qml+7−1
plugins/Dash/CardCreator.js+2−1
@@ -320,7 +320,8 @@ function cardString(template, components) {
320320 var hasSummary = components["summary"] || false;
321321 var artAndSummary = hasArt && hasSummary;
322322 var isHorizontal = template["card-layout"] === "horizontal";
323− var hasBackground = (hasSummary || !isHorizontal) && (template["card-background"] || components["background"] || artAndSummary);
323+ var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
324+ (hasSummary && (template["card-background"] || components["background"]));
324325 var hasTitle = components["title"] || false;
325326 var hasMascot = components["mascot"] || false;
326327 var hasEmblem = components["emblem"] && !(hasMascot && template["card-size"] === "small") || false;
tests/qmltests/Dash/tst_Card.qml+7−1
@@ -60,7 +60,7 @@ Rectangle {
6060 "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": { "aspect-ratio": 0.7 } }) }
6161 },
6262 {
63− "name": "Art, header, summary - horizontal",
63+ "name": "Art, header, summary, background - horizontal",
6464 "layout": { "template": { "card-layout": "horizontal", "card-background": { "type": "gradient", "elements": ["grey", "white"] } },
6565 "components": JSON.parse(Helpers.fullMapping) }
6666 },
@@ -101,6 +101,11 @@ Rectangle {
101101 "layout": { "template": { "overlay": true },
102102 "components": { "art": "art", "title": "title" } }
103103 },
104+ {
105+ "name": "Art, header, summary - horizontal",
106+ "layout": { "template": { "card-layout": "horizontal" },
107+ "components": JSON.parse(Helpers.fullMapping) }
108+ },
104109 ]
105110
106111 CardTool {
@@ -415,6 +420,7 @@ Rectangle {
415420 background: Qt.resolvedUrl("artwork/checkers.png"), index: 10 },
416421 { tag: "Gradient background", visible: true, color: "#808080", gradientColor: "#ffffff", index: 11 },
417422 { tag: "Image background", visible: true, image: Qt.resolvedUrl("artwork/checkers.png"), index: 12 },
423+ { tag: "Horizontal no background", visible: false, index: 14 },
418424 ];
419425 }
420426