@@ -227,13 +227,14 @@ var kTitleLabelCode = 'Label { \n\
227 horizontalAlignment: root.headerAlignment; \n\
227 horizontalAlignment: root.headerAlignment; \n\
230+// %1 is used as extra anchors of emblemImage
230var kEmblemImageCode = 'Image { \n\
231var kEmblemImageCode = 'Image { \n\
231 id: emblemImage; \n\
232 id: emblemImage; \n\
232 objectName: "emblemImage"; \n\
233 objectName: "emblemImage"; \n\
233 anchors { \n\
234 anchors { \n\
234 bottom: titleLabel.baseline; \n\
235 bottom: titleLabel.baseline; \n\
235 right: parent.right; \n\
236 right: parent.right; \n\
236− rightMargin: units.gu(1); \n\
237+ %1
238 source: cardData && cardData["emblem"] || ""; \n\
239 source: cardData && cardData["emblem"] || ""; \n\
239 width: height; \n\
240 width: height; \n\
@@ -394,6 +395,8 @@ function cardString(template, components) {
394 headerLeftAnchor = 'left: parent.left;\n';
395 headerLeftAnchor = 'left: parent.left;\n';
398+ var touchdownOnArtShape = !hasBackground && hasArt && !hasMascot && !hasSummary;
397 if (hasHeaderRow) {
400 if (hasHeaderRow) {
398 code += 'readonly property int headerHeight: row.height;\n'
401 code += 'readonly property int headerHeight: row.height;\n'
399 } else if (hasMascot) {
402 } else if (hasMascot) {
@@ -459,6 +462,13 @@ function cardString(template, components) {
459 var titleContainerAnchors;
462 var titleContainerAnchors;
460 var titleRightAnchor;
463 var titleRightAnchor;
465+ var extraRightAnchor = '';
466+ var extraLeftAnchor = '';
467+ if (!touchdownOnArtShape) {
468+ extraRightAnchor = 'rightMargin: units.gu(1); \n';
469+ extraLeftAnchor = 'leftMargin: units.gu(1); \n';
462 if (hasMascot) {
472 if (hasMascot) {
463 titleContainerAnchors = 'verticalCenter: parent.verticalCenter; ';
473 titleContainerAnchors = 'verticalCenter: parent.verticalCenter; ';
@@ -466,15 +476,15 @@ function cardString(template, components) {
466 titleContainerAnchors += headerLeftAnchor;
476 titleContainerAnchors += headerLeftAnchor;
467 titleContainerAnchors += headerVerticalAnchors;
477 titleContainerAnchors += headerVerticalAnchors;
468 if (!headerLeftAnchorHasMargin) {
478 if (!headerLeftAnchorHasMargin) {
469− titleContainerAnchors += 'leftMargin: units.gu(1);\n';
479+ titleContainerAnchors += extraLeftAnchor;
472 if (hasEmblem) {
482 if (hasEmblem) {
473 titleRightAnchor = 'right: emblemImage.left; \n\
483 titleRightAnchor = 'right: emblemImage.left; \n\
474 rightMargin: emblemImage.width > 0 ? units.gu(0.5) : 0; \n';
484 rightMargin: emblemImage.width > 0 ? units.gu(0.5) : 0; \n';
476− titleRightAnchor = 'right: parent.right; \n\
486+ titleRightAnchor = 'right: parent.right; \n'
477− rightMargin: units.gu(1); \n';
487+ titleRightAnchor += extraRightAnchor;
480 if (hasTitleContainer) {
490 if (hasTitleContainer) {
@@ -483,8 +493,8 @@ function cardString(template, components) {
483 titleAnchors += 'left: parent.left; \n\
493 titleAnchors += 'left: parent.left; \n\
484 top: parent.top;';
494 top: parent.top;';
485 subtitleAnchors = 'right: parent.right; \n\
495 subtitleAnchors = 'right: parent.right; \n\
486− left: parent.left; \n\
496+ left: parent.left; \n';
487− rightMargin: units.gu(1); \n';
497+ subtitleAnchors += extraRightAnchor;
488 if (hasSubtitle) {
498 if (hasSubtitle) {
489 attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
499 attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
490 subtitleAnchors += 'top: titleLabel.bottom;\n';
500 subtitleAnchors += 'top: titleLabel.bottom;\n';
@@ -508,12 +518,12 @@ function cardString(template, components) {
508 titleAnchors += headerLeftAnchor;
518 titleAnchors += headerLeftAnchor;
509 titleAnchors += headerVerticalAnchors;
519 titleAnchors += headerVerticalAnchors;
510 if (!headerLeftAnchorHasMargin) {
520 if (!headerLeftAnchorHasMargin) {
511− titleAnchors += 'leftMargin: units.gu(1);\n';
521+ titleAnchors += extraLeftAnchor;
514 subtitleAnchors = 'left: titleLabel.left; \n\
524 subtitleAnchors = 'left: titleLabel.left; \n\
515− leftMargin: titleLabel.leftMargin; \n\
525+ leftMargin: titleLabel.leftMargin; \n';
516− rightMargin: units.gu(1); \n';
526+ subtitleAnchors += extraRightAnchor;
517 if (hasEmblem) {
527 if (hasEmblem) {
518 // using container
528 // using container
519 subtitleAnchors += 'right: parent.right; \n';
529 subtitleAnchors += 'right: parent.right; \n';
@@ -534,7 +544,6 @@ function cardString(template, components) {
534 var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra);
544 var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra);
535 var subtitleCode;
545 var subtitleCode;
536 var attributesCode;
546 var attributesCode;
539 // code for the title container
548 // code for the title container
540 var containerCode = [];
549 var containerCode = [];
@@ -546,11 +555,11 @@ function cardString(template, components) {
546 containerHeight += ' + subtitleLabel.height';
555 containerHeight += ' + subtitleLabel.height';
548 if (hasEmblem) {
557 if (hasEmblem) {
549− containerCode.push(kEmblemImageCode);
558+ containerCode.push(kEmblemImageCode.arg(extraRightAnchor));
551 if (hasAttributes) {
560 if (hasAttributes) {
552 attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(titleColor);
561 attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(titleColor);
553− containerCode.push(kAttributesRowCode.arg(attributesAnchors).arg(titleColor));
562+ containerCode.push(attributesCode);
554 containerHeight += ' + attributesRow.height';
563 containerHeight += ' + attributesRow.height';
@@ -607,7 +616,7 @@ function cardString(template, components) {
607 var touchdownAnchors;
616 var touchdownAnchors;
608 if (hasBackground) {
617 if (hasBackground) {
609 touchdownAnchors = 'fill: backgroundLoader';
618 touchdownAnchors = 'fill: backgroundLoader';
610− } else if (hasArt && !hasMascot && !hasSummary) {
619+ } else if (touchdownOnArtShape) {
611 touchdownAnchors = 'fill: artShapeHolder';
620 touchdownAnchors = 'fill: artShapeHolder';
613 touchdownAnchors = 'fill: root'
622 touchdownAnchors = 'fill: root'