on xenial help sign in
Don't use the .y to calculate height, otherwise we end up in loops here
commit7bec496bd1091c8cab694bbf8923bc66e93687b3 authorAlbert Astals <albert.astals@canonical.com> dateWed 7 May 2014, 17:30 (12 years ago) parent6208d86
3 files changed+3−3
plugins/Dash/CardCreator.js+1−1 tests/plugins/Dash/cardcreator/3.res+1−1 tests/plugins/Dash/cardcreator/5.res+1−1
plugins/Dash/CardCreator.js+1−1
@@ -368,7 +368,7 @@ function cardString(template, components) {
368368 } else if (hasMascot) {
369369 code += 'readonly property int headerHeight: mascotImage.height + units.gu(1) * 2;\n'
370370 } else if (hasSubtitle) {
371− code += 'readonly property int headerHeight: subtitleLabel.y + subtitleLabel.height - titleLabel.y + titleLabel.anchors.topMargin * 2 + subtitleLabel.anchors.topMargin;\n'
371+ code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
372372 } else if (hasTitle) {
373373 code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2;\n'
374374 } else {
tests/plugins/Dash/cardcreator/3.res+1−1
@@ -54,7 +54,7 @@ Item {
5454 }
5555 }
5656 }
57−readonly property int headerHeight: subtitleLabel.y + subtitleLabel.height - titleLabel.y + titleLabel.anchors.topMargin * 2 + subtitleLabel.anchors.topMargin;
57+readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;
5858Label {
5959 id: titleLabel;
6060 objectName: "titleLabel";
tests/plugins/Dash/cardcreator/5.res+1−1
@@ -94,7 +94,7 @@ Loader {
9494 }";
9595 }
9696 }
97−readonly property int headerHeight: subtitleLabel.y + subtitleLabel.height - titleLabel.y + titleLabel.anchors.topMargin * 2 + subtitleLabel.anchors.topMargin;
97+readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;
9898Label {
9999 id: titleLabel;
100100 objectName: "titleLabel";