on xenial help sign in
Add code for subtitle is not appeared
commit07ce507529af533175e7e986683ca5d3daba56a3 authorYing-Chun Liu <paul.liu@canonical.com> dateWed 23 Jul 2014, 21:51 (12 years ago) parent8cf8e82
1 file changed+16−6
plugins/Dash/CardCreator.js+16−6
plugins/Dash/CardCreator.js+16−6
@@ -402,7 +402,13 @@ function cardString(template, components) {
402402 } else if (hasMascot) {
403403 code += 'readonly property int headerHeight: mascotImage.height;\n'
404404 } else if (hasAttributes) {
405− code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + subtitleLabel.height + subtitleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
405+ if (hasSubtitle) {
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) {
408+ code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
409+ } else {
410+ code += 'readonly property int headerHeight: attributesRow.height + attributesRow.anchors.topMargin;\n'
411+ }
406412 } else if (hasSubtitle) {
407413 code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
408414 } else if (hasTitle) {
@@ -482,11 +488,15 @@ function cardString(template, components) {
482488 right: titleLabel.right; \n\
483489 top: titleLabel.bottom; \n\
484490 topMargin: units.dp(2);\n';
485− attributesAnchors = 'left: subtitleLabel.left; \n\
486− leftMargin: subtitleLabel.leftMargin; \n\
487− right: subtitleLabel.right; \n\
488− top: subtitleLabel.bottom; \n\
489− topMargin: units.dp(2);\n';
491+ if (hasSubtitle) {
492+ attributesAnchors = 'left: subtitleLabel.left; \n\
493+ leftMargin: subtitleLabel.leftMargin; \n\
494+ right: subtitleLabel.right; \n\
495+ top: subtitleLabel.bottom; \n\
496+ topMargin: units.dp(2);\n';
497+ } else {
498+ attributesAnchors = subtitleAnchors;
499+ }
490500 }
491501
492502 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');