@@ -96,6 +96,11 @@ Rectangle {
96 "layout": { "template": { "card-background": Qt.resolvedUrl("artwork/checkers.png") },
96 "layout": { "template": { "card-background": Qt.resolvedUrl("artwork/checkers.png") },
97 "components": JSON.parse(Helpers.fullMapping) }
97 "components": JSON.parse(Helpers.fullMapping) }
100+ "name": "Art, title - overlaid",
101+ "layout": { "template": { "overlay": true },
102+ "components": { "art": "art", "title": "title" } }
101 CardTool {
106 CardTool {
@@ -217,6 +222,7 @@ Rectangle {
218 function test_card_binding(data) {
223 function test_card_binding(data) {
219 selector.selectedIndex = data.index;
224 selector.selectedIndex = data.index;
225+ waitForRendering(selector);
220 waitForRendering(card);
226 waitForRendering(card);
222 tryCompareFunction(function() { return testCase[data.object] !== null }, true);
228 tryCompareFunction(function() { return testCase[data.object] !== null }, true);
@@ -247,6 +253,8 @@ Rectangle {
248 function test_card_size(data) {
254 function test_card_size(data) {
249 selector.selectedIndex = data.index;
255 selector.selectedIndex = data.index;
256+ waitForRendering(selector);
257+ waitForRendering(card);
251 if (data.hasOwnProperty("card_layout")) {
259 if (data.hasOwnProperty("card_layout")) {
252 cardTool.template['card-layout'] = data.card_layout;
260 cardTool.template['card-layout'] = data.card_layout;
@@ -279,6 +287,7 @@ Rectangle {
280 function test_art_size(data) {
288 function test_art_size(data) {
281 selector.selectedIndex = data.index;
289 selector.selectedIndex = data.index;
290+ waitForRendering(selector);
282 if (data.hasOwnProperty("size")) {
291 if (data.hasOwnProperty("size")) {
283 cardTool.template['card-size'] = data.size;
292 cardTool.template['card-size'] = data.size;
284 cardTool.templateChanged();
293 cardTool.templateChanged();
@@ -310,6 +319,7 @@ Rectangle {
311 function test_art_shape_fixed_size() {
320 function test_art_shape_fixed_size() {
312 selector.selectedIndex = 6;
321 selector.selectedIndex = 6;
322+ waitForRendering(selector);
313 card.fixedArtShapeSize = Qt.size( units.gu(8), units.gu(4) );
323 card.fixedArtShapeSize = Qt.size( units.gu(8), units.gu(4) );
314 waitForRendering(card);
324 waitForRendering(card);
315 tryCompare(art, "width", units.gu(8));
325 tryCompare(art, "width", units.gu(8));
@@ -326,6 +336,7 @@ Rectangle {
327 function test_art_layout(data) {
337 function test_art_layout(data) {
328 selector.selectedIndex = data.index;
338 selector.selectedIndex = data.index;
339+ waitForRendering(selector);
329 waitForRendering(card);
340 waitForRendering(card);
331 tryCompare(headerRow, "x", data.left());
342 tryCompare(headerRow, "x", data.left());
@@ -344,6 +355,7 @@ Rectangle {
345 function test_header_layout(data) {
356 function test_header_layout(data) {
346 selector.selectedIndex = data.index;
357 selector.selectedIndex = data.index;
358+ waitForRendering(selector);
347 waitForRendering(card);
359 waitForRendering(card);
349 tryCompareFunction(function() { return testCase.headerRow.y === data.top() }, true);
361 tryCompareFunction(function() { return testCase.headerRow.y === data.top() }, true);
@@ -359,7 +371,7 @@ Rectangle {
360 function test_summary_layout(data) {
372 function test_summary_layout(data) {
361 selector.selectedIndex = data.index;
373 selector.selectedIndex = data.index;
362−
374+ waitForRendering(selector);
363 waitForRendering(card);
375 waitForRendering(card);
365 tryCompareFunction(function() { return art.height > 0 && testCase.summary.y === data.top() }, true);
377 tryCompareFunction(function() { return art.height > 0 && testCase.summary.y === data.top() }, true);
@@ -367,6 +379,8 @@ Rectangle {
368 function test_art_visibility() {
380 function test_art_visibility() {
369 selector.selectedIndex = 8;
381 selector.selectedIndex = 8;
382+ waitForRendering(selector);
383+ waitForRendering(card);
371 compare(testCase.artImage, null);
385 compare(testCase.artImage, null);
372 compare(testCase.art, null);
386 compare(testCase.art, null);
@@ -389,6 +403,7 @@ Rectangle {
390 function test_background(data) {
404 function test_background(data) {
391 selector.selectedIndex = data.index;
405 selector.selectedIndex = data.index;
406+ waitForRendering(selector);
393 if (data.hasOwnProperty("background")) {
408 if (data.hasOwnProperty("background")) {
394 card.cardData["background"] = data.background;
409 card.cardData["background"] = data.background;
@@ -425,6 +440,8 @@ Rectangle {
426 function test_font_weights(data) {
441 function test_font_weights(data) {
427 selector.selectedIndex = data.index;
442 selector.selectedIndex = data.index;
443+ waitForRendering(selector);
444+ waitForRendering(card);
429 tryCompare(testCase.title.font, "weight", data.weight);
446 tryCompare(testCase.title.font, "weight", data.weight);
@@ -448,6 +465,7 @@ Rectangle {
449 function test_fontColor(data) {
466 function test_fontColor(data) {
450 selector.selectedIndex = 10;
467 selector.selectedIndex = 10;
468+ waitForRendering(selector);
451 waitForRendering(card);
469 waitForRendering(card);
453 background.color = data.tag;
471 background.color = data.tag;
@@ -470,6 +488,7 @@ Rectangle {
471 function test_emblemIcon(data) {
489 function test_emblemIcon(data) {
472 selector.selectedIndex = data.index;
490 selector.selectedIndex = data.index;
491+ waitForRendering(selector);
473 waitForRendering(card);
492 waitForRendering(card);
475 var emblemIcon = findChild(card, "emblemIcon");
494 var emblemIcon = findChild(card, "emblemIcon");
@@ -486,6 +505,7 @@ Rectangle {
487 function test_mascotShape(data) {
506 function test_mascotShape(data) {
488 selector.selectedIndex = data.index;
507 selector.selectedIndex = data.index;
508+ waitForRendering(selector);
489 waitForRendering(card);
509 waitForRendering(card);
491 var shape = findChild(card, "mascotShapeLoader");
511 var shape = findChild(card, "mascotShapeLoader");
@@ -496,6 +516,8 @@ Rectangle {
497 function test_touchdown_visibility() {
517 function test_touchdown_visibility() {
498 selector.selectedIndex = 0;
518 selector.selectedIndex = 0;
519+ waitForRendering(selector);
520+ waitForRendering(card);
500 var touchdown = findChild(card, "touchdown");
522 var touchdown = findChild(card, "touchdown");
@@ -505,5 +527,44 @@ Rectangle {
505 mouseRelease(card, card.width/2, card.height/2);
527 mouseRelease(card, card.width/2, card.height/2);
506 compare(touchdown.visible, false);
528 compare(touchdown.visible, false);
531+ function test_paddings_data() {
533+ { tag: "Art and summary", index: 0 },
534+ { tag: "No Summary", index: 6 },
535+ { tag: "No header", index: 7 },
536+ { tag: "Header only", index: 8 },
537+ { tag: "Art, header, summary - overlaid", index: 9 },
538+ { tag: "Art, title - overlaid", index: 13 },
542+ function test_paddings(data) {
543+ selector.selectedIndex = data.index;
544+ waitForRendering(selector);
545+ waitForRendering(card);
547+ if (title) var titleToCard = title.mapToItem(card, 0, 0, title.width, title.height);
551+ var mascotToCard = mascotImage.mapToItem(card, 0, 0, mascotImage.width, mascotImage.height);
552+ verify(mascotToCard.x === units.gu(1));
554+ verify((titleToCard.x - mascotToCard.x - mascotToCard.width) === units.gu(1));
557+ verify(titleToCard.x === units.gu(1));
561+ var emblemIcon = findChild(card, "emblemIcon");
563+ var emblemToCard = emblemIcon.mapToItem(card, 0, 0, emblemIcon.width, emblemIcon.height);
564+ verify((card.width - emblemToCard.x - emblemToCard.width) === units.gu(1));
566+ verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1));