on xenial help sign in
Make the rowHeight be the headerHeight if we have it
0e3eeacAlbert Astals
plugins/Dash/CardCreator.js+8−6
@@ -108,7 +108,7 @@ var kOverlayLoaderCode = 'Loader { \n\
108 visible: showHeader && status == Loader.Ready; \n\
108 visible: showHeader && status == Loader.Ready; \n\
109 sourceComponent: ShaderEffect { \n\
109 sourceComponent: ShaderEffect { \n\
110 id: overlay; \n\
110 id: overlay; \n\
111− height: fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight; \n\
111+ height: fixedHeaderHeight != -1 ? fixedHeaderHeight + units.gu(1) * 2 : headerHeight; \n\
112 opacity: 0.6; \n\
112 opacity: 0.6; \n\
113 property var source: ShaderEffectSource { \n\
113 property var source: ShaderEffectSource { \n\
114 id: shaderSource; \n\
114 id: shaderSource; \n\
@@ -145,6 +145,7 @@ var kHeaderRow2Code = 'Row { \n\
145 objectName: "outerRow"; \n\
145 objectName: "outerRow"; \n\
146 property real margins: units.gu(1); \n\
146 property real margins: units.gu(1); \n\
147 spacing: margins; \n\
147 spacing: margins; \n\
148+ height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
148 anchors { %1 } \n\
149 anchors { %1 } \n\
149 anchors.right: parent.right; \n\
150 anchors.right: parent.right; \n\
150 anchors.margins: margins;\n\
151 anchors.margins: margins;\n\
@@ -163,6 +164,7 @@ var kHeaderRow3Code = 'Row { \n\
163 objectName: "outerRow"; \n\
164 objectName: "outerRow"; \n\
164 property real margins: units.gu(1); \n\
165 property real margins: units.gu(1); \n\
165 spacing: margins; \n\
166 spacing: margins; \n\
167+ height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
166 anchors { %1 } \n\
168 anchors { %1 } \n\
167 anchors.right: parent.right; \n\
169 anchors.right: parent.right; \n\
168 anchors.margins: margins;\n\
170 anchors.margins: margins;\n\
@@ -315,7 +317,7 @@ function cardString(template, components) {
315 anchors = 'left: parent.left';
317 anchors = 'left: parent.left';
316 if (hasMascot || hasTitle) {
318 if (hasMascot || hasTitle) {
317 widthCode = 'height * artShape.aspect'
319 widthCode = 'height * artShape.aspect'
318− heightCode = 'headerHeight';
320+ heightCode = 'headerHeight + 2 * units.gu(1)';
319 } else {
321 } else {
320 // This side of the else is a bit silly, who wants an horizontal layout without mascot and title?
322 // This side of the else is a bit silly, who wants an horizontal layout without mascot and title?
321 // So we define a "random" height of the image height + 2 gu for the margins
323 // So we define a "random" height of the image height + 2 gu for the margins
@@ -366,13 +368,13 @@ function cardString(template, components) {
366 }
368 }
367
369
368 if (hasHeaderRow) {
370 if (hasHeaderRow) {
369− code += 'readonly property int headerHeight: row.height + row.margins * 2;\n'
371+ code += 'readonly property int headerHeight: row.height;\n'
370 } else if (hasMascot) {
372 } else if (hasMascot) {
371− code += 'readonly property int headerHeight: mascotImage.height + units.gu(1) * 2;\n'
373+ code += 'readonly property int headerHeight: mascotImage.height;\n'
372 } else if (hasSubtitle) {
374 } else if (hasSubtitle) {
373− code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
375+ code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
374 } else if (hasTitle) {
376 } else if (hasTitle) {
375− code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2;\n'
377+ code += 'readonly property int headerHeight: titleLabel.height;\n'
376 } else {
378 } else {
377 code += 'readonly property int headerHeight: 0;\n'
379 code += 'readonly property int headerHeight: 0;\n'
378 }
380 }
qml/Dash/CardVerticalJournal.qml+1
@@ -66,6 +66,7 @@ DashRenderer {
66 item.width = Qt.binding(function() { return cardTool.cardWidth; });
66 item.width = Qt.binding(function() { return cardTool.cardWidth; });
67 item.height = Qt.binding(function() { return cardTool.cardHeight; });
67 item.height = Qt.binding(function() { return cardTool.cardHeight; });
68 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
68 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
69+ item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
69 item.cardData = Qt.binding(function() { return model; });
70 item.cardData = Qt.binding(function() { return model; });
70 item.template = Qt.binding(function() { return cardTool.template; });
71 item.template = Qt.binding(function() { return cardTool.template; });
71 item.components = Qt.binding(function() { return cardTool.components; });
72 item.components = Qt.binding(function() { return cardTool.components; });
tests/plugins/Dash/cardcreator/1.res+1−1
@@ -56,7 +56,7 @@ Item {
56 }
56 }
57 }
57 }
58 }
58 }
59−readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2;
59+readonly property int headerHeight: titleLabel.height;
60Label {
60Label {
61 id: titleLabel;
61 id: titleLabel;
62 objectName: "titleLabel";
62 objectName: "titleLabel";
tests/plugins/Dash/cardcreator/2.res+2−1
@@ -46,12 +46,13 @@ Loader {
46 }
46 }
47 }
47 }
48readonly property size artShapeSize: Qt.size(-1, -1);
48readonly property size artShapeSize: Qt.size(-1, -1);
49−readonly property int headerHeight: row.height + row.margins * 2;
49+readonly property int headerHeight: row.height;
50Row {
50Row {
51 id: row;
51 id: row;
52 objectName: "outerRow";
52 objectName: "outerRow";
53 property real margins: units.gu(1);
53 property real margins: units.gu(1);
54 spacing: margins;
54 spacing: margins;
55+ height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
55 anchors { top: parent.top;
56 anchors { top: parent.top;
56 topMargin: units.gu(1);
57 topMargin: units.gu(1);
57 left: parent.left;
58 left: parent.left;
tests/plugins/Dash/cardcreator/3.res+1−1
@@ -56,7 +56,7 @@ Item {
56 }
56 }
57 }
57 }
58 }
58 }
59−readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;
59+readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
60Label {
60Label {
61 id: titleLabel;
61 id: titleLabel;
62 objectName: "titleLabel";
62 objectName: "titleLabel";
tests/plugins/Dash/cardcreator/4.res+2−1
@@ -13,12 +13,13 @@ AbstractButton {
13 property bool showHeader: true;
13 property bool showHeader: true;
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15readonly property size artShapeSize: Qt.size(-1, -1);
15readonly property size artShapeSize: Qt.size(-1, -1);
16−readonly property int headerHeight: row.height + row.margins * 2;
16+readonly property int headerHeight: row.height;
17Row {
17Row {
18 id: row;
18 id: row;
19 objectName: "outerRow";
19 objectName: "outerRow";
20 property real margins: units.gu(1);
20 property real margins: units.gu(1);
21 spacing: margins;
21 spacing: margins;
22+ height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
22 anchors { top: parent.top;
23 anchors { top: parent.top;
23 topMargin: units.gu(1);
24 topMargin: units.gu(1);
24 left: parent.left;
25 left: parent.left;
tests/plugins/Dash/cardcreator/5.res+2−2
@@ -68,7 +68,7 @@ Loader {
68 visible: showHeader && status == Loader.Ready;
68 visible: showHeader && status == Loader.Ready;
69 sourceComponent: ShaderEffect {
69 sourceComponent: ShaderEffect {
70 id: overlay;
70 id: overlay;
71− height: fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight;
71+ height: fixedHeaderHeight != -1 ? fixedHeaderHeight + units.gu(1) * 2 : headerHeight;
72 opacity: 0.6;
72 opacity: 0.6;
73 property var source: ShaderEffectSource {
73 property var source: ShaderEffectSource {
74 id: shaderSource;
74 id: shaderSource;
@@ -96,7 +96,7 @@ Loader {
96 }";
96 }";
97 }
97 }
98 }
98 }
99−readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;
99+readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
100Label {
100Label {
101 id: titleLabel;
101 id: titleLabel;
102 objectName: "titleLabel";
102 objectName: "titleLabel";