on xenial help sign in
Horizontal art and summary has no background, added test
commit238e163052edfcb6c1ce386cbebf0ef1ab1cc721 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 22 Jan 2015, 12:05 (12 years ago) parent24e1c78
2 files changed+8−1
plugins/Dash/CardCreator.js+2−1 tests/qmltests/Dash/tst_Card.qml+6
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+6
@@ -101,6 +101,11 @@ Rectangle {
101101 "layout": { "template": { "overlay": true },
102102 "components": { "art": "art", "title": "title" } }
103103 },
104+ {
105+ "name": "Art, summary, - horizontal",
106+ "layout": { "template": { "card-layout": "horizontal" },
107+ "components": { "art": "art", "summary": "summary" } }
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 art and summary", visible: false, index: 14 },
418424 ];
419425 }
420426