@@ -190,9 +190,10 @@ var kAudioButtonCode = 'AbstractButton { \n\
192// %1 is whether the loader should be asynchronous or not
192// %1 is whether the loader should be asynchronous or not
193+// %2 is the header height code
193var kOverlayLoaderCode = 'Loader { \n\
194var kOverlayLoaderCode = 'Loader { \n\
194 id: overlayLoader; \n\
195 id: overlayLoader; \n\
195− readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\
196+ readonly property real overlayHeight: %2 + units.gu(2); \n\
196 anchors.fill: artShapeHolder; \n\
197 anchors.fill: artShapeHolder; \n\
197 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
198 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
198 asynchronous: %1; \n\
199 asynchronous: %1; \n\
@@ -214,17 +215,24 @@ function kHeaderRowCodeGenerator() {
214 objectName: "outerRow"; \n\
215 objectName: "outerRow"; \n\
215 property real margins: units.gu(1); \n\
216 property real margins: units.gu(1); \n\
216 spacing: margins; \n\
217 spacing: margins; \n\
217− height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
218+ %2\
218 anchors { %1 } \n\
219 anchors { %1 } \n\
219 anchors.right: parent.right; \n\
220 anchors.right: parent.right; \n\
220 anchors.margins: margins; \n\
221 anchors.margins: margins; \n\
221 anchors.rightMargin: 0; \n\
222 anchors.rightMargin: 0; \n\
222 data: [ \n\
223 data: [ \n\
226 var args = Array.prototype.slice.call(arguments);
227 var args = Array.prototype.slice.call(arguments);
228+ var isCardTool = args.shift();
231+ heightCode = "height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n";
227− var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(args.join(',\n'));
235+ var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(heightCode).arg(args.join(',\n'));
228 return code;
236 return code;
@@ -415,7 +423,7 @@ function cardString(template, components, isCardTool) {
415 property real fontScale: 1.0; \n\
423 property real fontScale: 1.0; \n\
416 property var scopeStyle: null; \n\
424 property var scopeStyle: null; \n\
417 property int titleAlignment: Text.AlignLeft; \n\
425 property int titleAlignment: Text.AlignLeft; \n\
418− property int fixedHeaderHeight: -1; \n\
426+ %2\
419 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
420 readonly property string title: cardData && cardData["title"] || ""; \n\
428 readonly property string title: cardData && cardData["title"] || ""; \n\
421 property bool showHeader: true; \n\
429 property bool showHeader: true; \n\
@@ -423,6 +431,12 @@ function cardString(template, components, isCardTool) {
423 enabled: %1; \n\
431 enabled: %1; \n\
424 \n'.arg(templateInteractive);
432 \n'.arg(templateInteractive);
435+ code = code.arg("property int fixedHeaderHeight: -1; \n");
437+ code = code.arg("");
426 var hasArt = components["art"] && components["art"]["field"] || false;
440 var hasArt = components["art"] && components["art"]["field"] || false;
427 var hasSummary = components["summary"] || false;
441 var hasSummary = components["summary"] || false;
428 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
442 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
@@ -524,7 +538,13 @@ function cardString(template, components, isCardTool) {
526 if (headerAsOverlay) {
540 if (headerAsOverlay) {
541+ var headerHeightCode;
543+ headerHeightCode = "headerHeight";
545+ headerHeightCode = "(fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight)";
527− code += kOverlayLoaderCode.arg(asynchronous);
547+ code += kOverlayLoaderCode.arg(asynchronous).arg(headerHeightCode);
530 var headerVerticalAnchors;
550 var headerVerticalAnchors;
@@ -770,7 +790,7 @@ function cardString(template, components, isCardTool) {
770 if (mascotShapeCode != '') {
790 if (mascotShapeCode != '') {
771 rowCode.unshift(mascotShapeCode);
791 rowCode.unshift(mascotShapeCode);
773− code += kHeaderRowCodeGenerator(headerVerticalAnchors + headerLeftAnchor, rowCode)
793+ code += kHeaderRowCodeGenerator(isCardTool, headerVerticalAnchors + headerLeftAnchor, rowCode)
775 code += mascotShapeCode + mascotCode + titleSubtitleCode;
795 code += mascotShapeCode + mascotCode + titleSubtitleCode;
@@ -794,7 +814,11 @@ function cardString(template, components, isCardTool) {
795 audioButtonAnchorsFill = 'undefined';
815 audioButtonAnchorsFill = 'undefined';
796 audioButtonWidth = 'height';
816 audioButtonWidth = 'height';
818+ audioButtonHeight = 'headerHeight + 2 * units.gu(1)';
797− audioButtonHeight = '(root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1)';
820+ audioButtonHeight = '(root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1)';
799 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);
823 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);