@@ -138,10 +138,9 @@ var kOverlayLoaderCode = 'Loader { \n\
138138 } \n\
139139 }\n';
140140
141−// %1 is used as anchors of row
142−// %2 is used as first child of the row
143−// %3 is used as second child of the row
144−var kHeaderRow2Code = 'Row { \n\
141+// multiple row version of HeaderRowCode
142+function kHeaderRowCodeGenerator() {
143+var kHeaderRowCodeTemplate = 'Row { \n\
145144 id: row; \n\
146145 objectName: "outerRow"; \n\
147146 property real margins: units.gu(1); \n\
@@ -149,58 +148,30 @@ var kHeaderRow2Code = 'Row { \n\
149148 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
150149 anchors { %1 } \n\
151150 anchors.right: parent.right; \n\
152− anchors.margins: margins;\n\
153− data: [ %2\n\
154− ,\n\
155− %3 \n\
151+ anchors.margins: margins; \n\
152+ anchors.rightMargin: 0; \n\
153+ data: [ \n\
154+ %2 \n\
156155 ] \n\
157156 }\n';
157+ var args = Array.prototype.slice.call(arguments);
158+ var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(args.join(',\n'));
159+ return code;
160+}
158161
159−// %1 is used as anchors of row
160−// %2 is used as first child of the row
161−// %3 is used as second child of the row
162−// %4 is used as third child of the row
163−var kHeaderRow3Code = 'Row { \n\
164− id: row; \n\
165− objectName: "outerRow"; \n\
166− property real margins: units.gu(1); \n\
167− spacing: margins; \n\
168− height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
169− anchors { %1 } \n\
170− anchors.right: parent.right; \n\
171− anchors.margins: margins;\n\
172− data: [ %2\n\
173− ,\n\
162+// multiple item version of kHeaderContainerCode
163+function kHeaderContainerCodeGenerator() {
164+ var headerContainerCodeTemplate = 'Item { \n\
165+ id: headerTitleContainer; \n\
166+ anchors { %1 } \n\
167+ width: parent.width - x; \n\
168+ implicitHeight: %2; \n\
169+ data: [ \n\
174170 %3 \n\
175− ,\n\
176− %4 \n\
177− ] \n\
178− }\n';
179−
180−// %1 is used as first child of the column
181−// %2 is used as second child of the column
182−var kHeaderColumnCode = 'Column { \n\
183− anchors.verticalCenter: parent.verticalCenter; \n\
184− spacing: units.dp(2); \n\
185− width: parent.width - x;\n\
186− data: [ %1\n\
187− ,\n\
188− %2 \n\
189− ] \n\
171+ ]\n\
190172 }\n';
191−
192−// multiple column version of kHeaderColumnCode.
193−function kHeaderColumnCodeGenerator() {
194− var headerColumnCodeTemplate = 'Column { \n\
195− anchors.verticalCenter: parent.verticalCenter; \n\
196− spacing: units.dp(2); \n\
197− width: parent.width - x;\n\
198− data: [ \n\
199− %1 \n\
200− ]\n\
201− }\n';
202173 var args = Array.prototype.slice.call(arguments);
203− var code = headerColumnCodeTemplate.arg(args.join(',\n'));
174+ var code = headerContainerCodeTemplate.arg(args.shift()).arg(args.shift()).arg(args.join(',\n'));
204175 return code;
205176}
206177
@@ -224,7 +195,7 @@ var kMascotImageCode = 'Image { \n\
224195 objectName: "mascotImage"; \n\
225196 anchors { %1 } \n\
226197 readonly property int maxSize: Math.max(width, height) * 4; \n\
227− source: cardData && cardData["mascot"]; \n\
198+ source: cardData && cardData["mascot"] || ""; \n\
228199 width: units.gu(6); \n\
229200 height: units.gu(5.625); \n\
230201 sourceSize { width: maxSize; height: maxSize } \n\
@@ -253,6 +224,22 @@ var kTitleLabelCode = 'Label { \n\
253224 horizontalAlignment: root.headerAlignment; \n\
254225 }\n';
255226
227+// %1 is used as extra anchors of emblemIcon
228+// %2 is used as color of emblemIcon
229+var kEmblemIconCode = 'Icon { \n\
230+ id: emblemIcon; \n\
231+ objectName: "emblemIcon"; \n\
232+ anchors { \n\
233+ bottom: titleLabel.baseline; \n\
234+ right: parent.right; \n\
235+ %1
236+ } \n\
237+ source: cardData && cardData["emblem"] || ""; \n\
238+ color: %2; \n\
239+ width: height; \n\
240+ height: source != "" ? titleLabel.font.pixelSize : 0; \n\
241+ }\n';
242+
256243// %1 is used as anchors of touchdown effect
257244var kTouchdownCode = 'UbuntuShape { \n\
258245 id: touchdown; \n\
@@ -269,6 +256,7 @@ var kSubtitleLabelCode = 'Label { \n\
269256 id: subtitleLabel; \n\
270257 objectName: "subtitleLabel"; \n\
271258 anchors { %1 } \n\
259+ anchors.topMargin: units.dp(2); \n\
272260 elide: Text.ElideRight; \n\
273261 fontSize: "small"; \n\
274262 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
@@ -280,12 +268,13 @@ var kSubtitleLabelCode = 'Label { \n\
280268 }\n';
281269
282270// %1 is used as anchors of attributesRow
271+// %2 is used as color of attributesRow
283272var kAttributesRowCode = 'CardAttributes { \n\
284273 id: attributesRow; \n\
285274 objectName: "attributesRow"; \n\
286275 anchors { %1 } \n\
287276 color: %2; \n\
288− model: cardData["attributes"]; \n\
277+ model: cardData && cardData["attributes"]; \n\
289278 }\n';
290279
291280// %1 is used as top anchor of summary
@@ -335,10 +324,11 @@ function cardString(template, components) {
335324 var hasBackground = !isHorizontal && (template["card-background"] || components["background"] || artAndSummary);
336325 var hasTitle = components["title"] || false;
337326 var hasMascot = components["mascot"] || false;
327+ var hasEmblem = components["emblem"] && !(hasMascot && template["card-size"] === "small") || false;
338328 var headerAsOverlay = hasArt && template && template["overlay"] === true && (hasTitle || hasMascot);
339329 var hasSubtitle = hasTitle && components["subtitle"] || false;
340330 var hasHeaderRow = hasMascot && hasTitle;
341− var hasAttributes = hasTitle && components["attributes"] || false;
331+ var hasAttributes = hasTitle && components["attributes"]["field"] || false;
342332
343333 if (hasBackground) {
344334 code += kBackgroundLoaderCode;
@@ -349,9 +339,9 @@ function cardString(template, components) {
349339 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
350340
351341 var widthCode, heightCode;
352− var anchors;
342+ var artAnchors;
353343 if (isHorizontal) {
354− anchors = 'left: parent.left';
344+ artAnchors = 'left: parent.left';
355345 if (hasMascot || hasTitle) {
356346 widthCode = 'height * artShape.aspect'
357347 heightCode = 'headerHeight + 2 * units.gu(1)';
@@ -362,12 +352,12 @@ function cardString(template, components) {
362352 heightCode = 'units.gu(7.625)';
363353 }
364354 } else {
365− anchors = 'horizontalCenter: parent.horizontalCenter;';
355+ artAnchors = 'horizontalCenter: parent.horizontalCenter;';
366356 widthCode = 'root.width'
367357 heightCode = 'width / artShape.aspect';
368358 }
369359
370− code += kArtShapeHolderCode.arg(anchors).arg(widthCode).arg(heightCode);
360+ code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode);
371361 } else {
372362 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
373363 }
@@ -404,6 +394,8 @@ function cardString(template, components) {
404394 headerLeftAnchor = 'left: parent.left;\n';
405395 }
406396
397+ var touchdownOnArtShape = !hasBackground && hasArt && !hasMascot && !hasSummary;
398+
407399 if (hasHeaderRow) {
408400 code += 'readonly property int headerHeight: row.height;\n'
409401 } else if (hasMascot) {
@@ -424,191 +416,239 @@ function cardString(template, components) {
424416 code += 'readonly property int headerHeight: 0;\n'
425417 }
426418
427− var mascotShapeCode = "";
428− var mascotCode = "";
419+ var mascotShapeCode = '';
420+ var mascotCode = '';
429421 if (hasMascot) {
430422 var useMascotShape = !hasBackground && !headerAsOverlay;
431− var anchors = "";
423+ var mascotAnchors = '';
432424 if (!hasHeaderRow) {
433− anchors += headerLeftAnchor;
434− anchors += headerVerticalAnchors;
425+ mascotAnchors += headerLeftAnchor;
426+ mascotAnchors += headerVerticalAnchors;
435427 if (!headerLeftAnchorHasMargin) {
436− anchors += 'leftMargin: units.gu(1);\n'
428+ mascotAnchors += 'leftMargin: units.gu(1);\n'
437429 }
438430 } else {
439− anchors = "verticalCenter: parent.verticalCenter;"
431+ mascotAnchors = 'verticalCenter: parent.verticalCenter;'
440432 }
441433
442434 if (useMascotShape) {
443− mascotShapeCode = kMascotShapeLoaderCode.arg(anchors);
435+ mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors);
444436 }
445437
446438 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
447− mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
439+ mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible);
448440 }
449441
450442 var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey")';
451443
452− var titleSubtitleCode = "";
444+ var hasTitleContainer = hasTitle && (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes)));
445+ var titleSubtitleCode = '';
453446 if (hasTitle) {
454− var color;
447+ var titleColor;
455448 if (headerAsOverlay) {
456− color = 'overlayLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey")';
449+ titleColor = 'overlayLoader.item.luminance < (root.scopeStyle ? root.scopeStyle.threshold : 0.7) ? (root.scopeStyle ? root.scopeStyle.light : "white") : (root.scopeStyle ? root.scopeStyle.dark : "grey")';
457450 } else if (hasSummary) {
458− color = 'summary.color';
451+ titleColor = 'summary.color';
459452 } else if (hasBackground) {
460− color = summaryColorWithBackground;
453+ titleColor = summaryColorWithBackground;
461454 } else {
462− color = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
455+ titleColor = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
463456 }
464457
465458 var titleAnchors;
466459 var subtitleAnchors;
467460 var attributesAnchors;
468− if (hasMascot && (hasSubtitle || hasAttributes)) {
469− // Using row + column
470− titleAnchors = 'left: parent.left; right: parent.right';
471− subtitleAnchors = titleAnchors;
472− attributesAnchors = subtitleAnchors;
461+ var titleContainerAnchors;
462+ var titleRightAnchor;
463+
464+ var extraRightAnchor = '';
465+ var extraLeftAnchor = '';
466+ if (!touchdownOnArtShape) {
467+ extraRightAnchor = 'rightMargin: units.gu(1); \n';
468+ extraLeftAnchor = 'leftMargin: units.gu(1); \n';
469+ }
470+
471+ if (hasMascot) {
472+ titleContainerAnchors = 'verticalCenter: parent.verticalCenter; ';
473+ } else {
474+ titleContainerAnchors = 'right: parent.right; ';
475+ titleContainerAnchors += headerLeftAnchor;
476+ titleContainerAnchors += headerVerticalAnchors;
477+ if (!headerLeftAnchorHasMargin) {
478+ titleContainerAnchors += extraLeftAnchor;
479+ }
480+ }
481+ if (hasEmblem) {
482+ titleRightAnchor = 'right: emblemIcon.left; \n\
483+ rightMargin: emblemIcon.width > 0 ? units.gu(0.5) : 0; \n';
484+ } else {
485+ titleRightAnchor = 'right: parent.right; \n'
486+ titleRightAnchor += extraRightAnchor;
487+ }
488+
489+ if (hasTitleContainer) {
490+ // Using headerTitleContainer
491+ titleAnchors = titleRightAnchor;
492+ titleAnchors += 'left: parent.left; \n\
493+ top: parent.top;';
494+ subtitleAnchors = 'right: parent.right; \n\
495+ left: parent.left; \n';
496+ subtitleAnchors += extraRightAnchor;
497+ if (hasSubtitle) {
498+ attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
499+ subtitleAnchors += 'top: titleLabel.bottom;\n';
500+ } else {
501+ attributesAnchors = subtitleAnchors + 'top: titleLabel.bottom;\n';
502+ }
473503 } else if (hasMascot) {
474− // Using row + label
475− titleAnchors = 'verticalCenter: parent.verticalCenter;\n'
504+ // Using row + titleContainer
505+ titleAnchors = 'verticalCenter: parent.verticalCenter;\n';
476506 } else {
477507 if (headerAsOverlay) {
478508 // Using anchors to the overlay
479− titleAnchors = 'left: parent.left; \n\
480− leftMargin: units.gu(1); \n\
481− right: parent.right; \n\
482− rightMargin: units.gu(1); \n\
483− top: overlayLoader.top; \n\
484− topMargin: units.gu(1);\n';
509+ titleAnchors = titleRightAnchor;
510+ titleAnchors += 'left: parent.left; \n\
511+ leftMargin: units.gu(1); \n\
512+ top: overlayLoader.top; \n\
513+ topMargin: units.gu(1);\n';
485514 } else {
486515 // Using anchors to the mascot/parent
487− titleAnchors = "right: parent.right;\n";
488− titleAnchors += "rightMargin: units.gu(1);\n";
516+ titleAnchors = titleRightAnchor;
489517 titleAnchors += headerLeftAnchor;
490518 titleAnchors += headerVerticalAnchors;
491519 if (!headerLeftAnchorHasMargin) {
492− titleAnchors += 'leftMargin: units.gu(1);\n'
520+ titleAnchors += extraLeftAnchor;
493521 }
494522 }
495523 subtitleAnchors = 'left: titleLabel.left; \n\
496− leftMargin: titleLabel.leftMargin; \n\
497− right: titleLabel.right; \n\
498− rightMargin: titleLabel.rightMargin; \n\
499− top: titleLabel.bottom; \n\
500− topMargin: units.dp(2);\n';
524+ leftMargin: titleLabel.leftMargin; \n';
525+ subtitleAnchors += extraRightAnchor;
526+ if (hasEmblem) {
527+ // using container
528+ subtitleAnchors += 'right: parent.right; \n';
529+ } else {
530+ subtitleAnchors += 'right: titleLabel.right; \n';
531+ }
532+
501533 if (hasSubtitle) {
502− attributesAnchors = 'left: subtitleLabel.left; \n\
503− leftMargin: subtitleLabel.leftMargin; \n\
504− right: subtitleLabel.right; \n\
505− rightMargin: subtitleLabel.rightMargin; \n\
506− top: subtitleLabel.bottom; \n\
507− topMargin: units.dp(2);\n';
534+ attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
535+ subtitleAnchors += 'top: titleLabel.bottom;\n';
508536 } else {
509− attributesAnchors = subtitleAnchors;
537+ attributesAnchors = subtitleAnchors + 'top: titleLabel.bottom;\n';
510538 }
511539 }
512540
541+ // code for different elements
513542 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
514− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(color).arg(titleLabelVisibleExtra);
515− var subtitleCode = "";
543+ var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra);
544+ var subtitleCode;
545+ var attributesCode;
546+
547+ // code for the title container
548+ var containerCode = [];
549+ var containerHeight = 'titleLabel.height';
550+ containerCode.push(titleCode);
516551 if (hasSubtitle) {
517− subtitleCode += kSubtitleLabelCode.arg(subtitleAnchors).arg(color);
552+ subtitleCode = kSubtitleLabelCode.arg(subtitleAnchors).arg(titleColor);
553+ containerCode.push(subtitleCode);
554+ containerHeight += ' + subtitleLabel.height';
555+ }
556+ if (hasEmblem) {
557+ containerCode.push(kEmblemIconCode.arg(extraRightAnchor).arg(titleColor));
558+ }
559+ if (hasAttributes) {
560+ attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(titleColor);
561+ containerCode.push(attributesCode);
562+ containerHeight += ' + attributesRow.height';
518563 }
519564
520− if (hasMascot && (hasSubtitle || hasAttributes)) {
521− // If using row + column wrap the code in the column
522− titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(subtitleCode);
523− if (hasSubtitle && hasAttributes) {
524− var attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(color);
525− titleSubtitleCode = kHeaderColumnCodeGenerator(titleCode, subtitleCode, attributesCode);
526− } else if (hasSubtitle) {
527− titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(subtitleCode);
528− } else if (hasAttributes) {
529− var attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(color);
530− titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(attributesCode);
531− }
565+ if (hasTitleContainer) {
566+ // use container
567+ titleSubtitleCode = kHeaderContainerCodeGenerator(titleContainerAnchors, containerHeight, containerCode);
532568 } else {
569+ // no container
533570 titleSubtitleCode = titleCode;
534571 if (hasSubtitle) {
535− titleSubtitleCode = titleSubtitleCode + subtitleCode;
572+ titleSubtitleCode += subtitleCode;
536573 }
537574 if (hasAttributes) {
538− var attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(color);
539− titleSubtitleCode = titleSubtitleCode + attributesCode;
575+ titleSubtitleCode += attributesCode;
540576 }
541577 }
542578 }
543579
544580 if (hasHeaderRow) {
545− if (mascotShapeCode != "") {
546− code += kHeaderRow3Code.arg(headerVerticalAnchors + headerLeftAnchor).arg(mascotShapeCode).arg(mascotCode).arg(titleSubtitleCode);
547− } else {
548− code += kHeaderRow2Code.arg(headerVerticalAnchors + headerLeftAnchor).arg(mascotCode).arg(titleSubtitleCode);
581+ var rowCode = [mascotCode, titleSubtitleCode];
582+ if (mascotShapeCode != '') {
583+ rowCode.unshift(mascotShapeCode);
549584 }
585+ code += kHeaderRowCodeGenerator(headerVerticalAnchors + headerLeftAnchor, rowCode)
550586 } else {
551587 code += mascotShapeCode + mascotCode + titleSubtitleCode;
552588 }
553589
554590 if (hasSummary) {
555591 var summaryTopAnchor;
556− if (isHorizontal && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
557− else if (headerAsOverlay && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
558− else if (hasHeaderRow) summaryTopAnchor = "row.bottom";
559− else if (hasMascot) summaryTopAnchor = "mascotImage.bottom";
560− else if (hasAttributes) summaryTopAnchor = "attributesRow.bottom";
561− else if (hasSubtitle) summaryTopAnchor = "subtitleLabel.bottom";
562− else if (hasTitle) summaryTopAnchor = "titleLabel.bottom";
563− else if (hasArt) summaryTopAnchor = "artShapeHolder.bottom";
564− else summaryTopAnchor = "parent.top";
565−
566− var color;
592+ if (isHorizontal && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
593+ else if (headerAsOverlay && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
594+ else if (hasHeaderRow) summaryTopAnchor = 'row.bottom';
595+ else if (hasTitleContainer) summaryTopAnchor = 'headerTitleContainer.bottom';
596+ else if (hasMascot) summaryTopAnchor = 'mascotImage.bottom';
597+ else if (hasAttributes) summaryTopAnchor = 'attributesRow.bottom';
598+ else if (hasSubtitle) summaryTopAnchor = 'subtitleLabel.bottom';
599+ else if (hasTitle) summaryTopAnchor = 'titleLabel.bottom';
600+ else if (hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
601+ else summaryTopAnchor = 'parent.top';
602+
603+ var summaryColor;
567604 if (hasBackground) {
568− color = summaryColorWithBackground;
605+ summaryColor = summaryColorWithBackground;
569606 } else {
570− color = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
607+ summaryColor = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
571608 }
572609
573610 var summaryTopMargin = (hasMascot || hasSubtitle || hasAttributes ? 'anchors.margins' : '0');
574611
575− code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(color);
612+ code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);
576613 }
577614
578615 var touchdownAnchors;
579616 if (hasBackground) {
580617 touchdownAnchors = 'fill: backgroundLoader';
581− } else if (hasArt && !hasMascot && !hasSummary) {
618+ } else if (touchdownOnArtShape) {
582619 touchdownAnchors = 'fill: artShapeHolder';
583620 } else {
584621 touchdownAnchors = 'fill: root'
585622 }
586623 code += kTouchdownCode.arg(touchdownAnchors);
587624
625+ var implicitHeight = 'implicitHeight: ';
588626 if (hasSummary) {
589− code += 'implicitHeight: summary.y + summary.height + (summary.text ? units.gu(1) : 0);\n';
627+ implicitHeight += 'summary.y + summary.height + (summary.text ? units.gu(1) : 0);\n';
590628 } else if (hasHeaderRow) {
591− code += 'implicitHeight: row.y + row.height + units.gu(1);\n';
629+ implicitHeight += 'row.y + row.height + units.gu(1);\n';
592630 } else if (hasMascot) {
593− code += 'implicitHeight: mascotImage.y + mascotImage.height;\n';
631+ implicitHeight += 'mascotImage.y + mascotImage.height;\n';
632+ } else if (hasTitleContainer) {
633+ implicitHeight += 'headerTitleContainer.y + headerTitleContainer.height + units.gu(1);\n';
594634 } else if (hasAttributes) {
595− code += 'implicitHeight: attributesRow.y + attributesRow.height + units.gu(1);\n';
635+ implicitHeight += 'attributesRow.y + attributesRow.height + units.gu(1);\n';
596636 } else if (hasSubtitle) {
597− code += 'implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
637+ implicitHeight += 'subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
598638 } else if (hasTitle) {
599− code += 'implicitHeight: titleLabel.y + titleLabel.height + units.gu(1);\n';
639+ implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
600640 } else if (hasArt) {
601− code += 'implicitHeight: artShapeHolder.height;\n';
641+ implicitHeight += 'artShapeHolder.height;\n';
602642 }
603643 // Close the AbstractButton
604− code += '}\n';
644+ code += implicitHeight + '}\n';
605645
606646 return code;
607647}
608648
609649function createCardComponent(parent, template, components) {
610650 var imports = 'import QtQuick 2.2; \n\
611− import Ubuntu.Components 0.1; \n\
651+ import Ubuntu.Components 1.1; \n\
612652 import Dash 0.1;\n';
613653 var card = cardString(template, components);
614654 var code = imports + 'Component {\n' + card + '}\n';