@@ -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,19 @@ 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();
229+ var heightCode = isCardTool ? "" : "height: root.fixedHeaderHeight; \n";
227− var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(args.join(',\n'));
230+ var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(heightCode).arg(args.join(',\n'));
228 return code;
231 return code;
@@ -415,7 +418,7 @@ function cardString(template, components, isCardTool) {
415 property string backgroundShapeStyle: "inset"; \n\
418 property string backgroundShapeStyle: "inset"; \n\
416 property real fontScale: 1.0; \n\
419 property real fontScale: 1.0; \n\
417 property var scopeStyle: null; \n\
420 property var scopeStyle: null; \n\
418− property int fixedHeaderHeight: -1; \n\
421+ %2\
419 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
422 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
420 readonly property string title: cardData && cardData["title"] || ""; \n\
423 readonly property string title: cardData && cardData["title"] || ""; \n\
421 property bool showHeader: true; \n\
424 property bool showHeader: true; \n\
@@ -423,6 +426,8 @@ function cardString(template, components, isCardTool) {
423 enabled: %1; \n\
426 enabled: %1; \n\
424 \n'.arg(templateInteractive);
427 \n'.arg(templateInteractive);
429+ code = code.arg(isCardTool ? "" : "property int fixedHeaderHeight: -1; \n");
426 var hasArt = components["art"] && components["art"]["field"] || false;
431 var hasArt = components["art"] && components["art"]["field"] || false;
427 var hasSummary = components["summary"] || false;
432 var hasSummary = components["summary"] || false;
428 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
433 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
@@ -524,7 +529,8 @@ function cardString(template, components, isCardTool) {
526 if (headerAsOverlay) {
531 if (headerAsOverlay) {
532+ var headerHeightCode = isCardTool ? "headerHeight" : "root.fixedHeaderHeight";
527− code += kOverlayLoaderCode.arg(asynchronous);
533+ code += kOverlayLoaderCode.arg(asynchronous).arg(headerHeightCode);
530 var headerVerticalAnchors;
536 var headerVerticalAnchors;
@@ -785,7 +791,7 @@ function cardString(template, components, isCardTool) {
785 if (mascotShapeCode != '') {
791 if (mascotShapeCode != '') {
786 rowCode.unshift(mascotShapeCode);
792 rowCode.unshift(mascotShapeCode);
788− code += kHeaderRowCodeGenerator(headerVerticalAnchors + headerLeftAnchor, rowCode)
794+ code += kHeaderRowCodeGenerator(isCardTool, headerVerticalAnchors + headerLeftAnchor, rowCode)
790 code += mascotShapeCode + mascotCode + titleSubtitleCode;
796 code += mascotShapeCode + mascotCode + titleSubtitleCode;
@@ -809,7 +815,8 @@ function cardString(template, components, isCardTool) {
810 audioButtonAnchorsFill = 'undefined';
816 audioButtonAnchorsFill = 'undefined';
811 audioButtonWidth = 'height';
817 audioButtonWidth = 'height';
812− audioButtonHeight = '(root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1)';
818+ audioButtonHeight = isCardTool ? 'headerHeight + 2 * units.gu(1)'
819+ : 'root.fixedHeaderHeight + 2 * units.gu(1)';
814 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);
821 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);