@@ -402,7 +402,7 @@ function cardString(template, components) {
402 } else if (hasMascot) {
402 } else if (hasMascot) {
403 code += 'readonly property int headerHeight: mascotImage.height;\n'
403 code += 'readonly property int headerHeight: mascotImage.height;\n'
404 } else if (hasAttributes) {
404 } else if (hasAttributes) {
405− if (hasSubtitle) {
405+ if (hasTitle && hasSubtitle) {
406 code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + subtitleLabel.height + subtitleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
406 code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + subtitleLabel.height + subtitleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
407 } else if (hasTitle) {
407 } else if (hasTitle) {
408 code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
408 code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
@@ -458,7 +458,7 @@ function cardString(template, components) {
458 var titleAnchors;
458 var titleAnchors;
459 var subtitleAnchors;
459 var subtitleAnchors;
460 var attributesAnchors;
460 var attributesAnchors;
461− if (hasMascot && hasSubtitle) {
461+ if (hasMascot && (hasSubtitle || hasAttributes)) {
462 // Using row + column
462 // Using row + column
463 titleAnchors = 'left: parent.left; right: parent.right';
463 titleAnchors = 'left: parent.left; right: parent.right';
464 subtitleAnchors = titleAnchors;
464 subtitleAnchors = titleAnchors;
@@ -506,15 +506,23 @@ function cardString(template, components) {
506 subtitleCode += kSubtitleLabelCode.arg(subtitleAnchors).arg(color);
506 subtitleCode += kSubtitleLabelCode.arg(subtitleAnchors).arg(color);
509− if (hasMascot && hasSubtitle) {
509+ if (hasMascot && (hasSubtitle || hasAttributes)) {
510 // If using row + column wrap the code in the column
510 // If using row + column wrap the code in the column
511 titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(subtitleCode);
511 titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(subtitleCode);
512− if (hasAttributes) {
512+ if (hasSubtitle && hasAttributes) {
513 var attributesCode = kAttributesRowCode.arg(attributesAnchors);
513 var attributesCode = kAttributesRowCode.arg(attributesAnchors);
514 titleSubtitleCode = kHeaderColumnCodeGenerator(titleCode, subtitleCode, attributesCode);
514 titleSubtitleCode = kHeaderColumnCodeGenerator(titleCode, subtitleCode, attributesCode);
515+ } else if (hasSubtitle) {
516+ titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(subtitleCode);
517+ } else if (hasAttributes) {
518+ var attributesCode = kAttributesRowCode.arg(attributesAnchors);
519+ titleSubtitleCode = kHeaderColumnCode.arg(titleCode).arg(attributesCode);
517− titleSubtitleCode = titleCode + subtitleCode;
522+ titleSubtitleCode = titleCode;
524+ titleSubtitleCode = titleSubtitleCode + subtitleCode;
518 if (hasAttributes) {
526 if (hasAttributes) {
519 var attributesCode = kAttributesRowCode.arg(attributesAnchors);
527 var attributesCode = kAttributesRowCode.arg(attributesAnchors);
520 titleSubtitleCode = titleSubtitleCode + attributesCode;
528 titleSubtitleCode = titleSubtitleCode + attributesCode;
@@ -581,5 +589,6 @@ function createCardComponent(parent, template, components) {
581 import Dash 0.1;\n';
589 import Dash 0.1;\n';
582 var card = cardString(template, components);
590 var card = cardString(template, components);
583 var code = imports + 'Component {\n' + card + '}\n';
591 var code = imports + 'Component {\n' + card + '}\n';
584 return Qt.createQmlObject(code, parent, "createCardComponent");
593 return Qt.createQmlObject(code, parent, "createCardComponent");