@@ -155,7 +155,7 @@ var kOverlayLoaderCode = 'Loader { \n\
156// multiple row version of HeaderRowCode
156// multiple row version of HeaderRowCode
157function kHeaderRowCodeGenerator() {
157function kHeaderRowCodeGenerator() {
158−var kHeaderRowCodeTemplate = 'Row { \n\
158+ var kHeaderRowCodeTemplate = 'Row { \n\
159 id: row; \n\
159 id: row; \n\
160 objectName: "outerRow"; \n\
160 objectName: "outerRow"; \n\
161 property real margins: units.gu(1); \n\
161 property real margins: units.gu(1); \n\
@@ -220,6 +220,7 @@ var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
220// %1 is used as anchors of titleLabel
220// %1 is used as anchors of titleLabel
221// %2 is used as color of titleLabel
221// %2 is used as color of titleLabel
222// %3 is used as extra condition for visible of titleLabel
222// %3 is used as extra condition for visible of titleLabel
223+// %4 is used as title width
223var kTitleLabelCode = 'Label { \n\
224var kTitleLabelCode = 'Label { \n\
224 id: titleLabel; \n\
225 id: titleLabel; \n\
225 objectName: "titleLabel"; \n\
226 objectName: "titleLabel"; \n\
@@ -231,6 +232,7 @@ var kTitleLabelCode = 'Label { \n\
231 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
232 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
232 color: %2; \n\
233 color: %2; \n\
233 visible: showHeader %3; \n\
234 visible: showHeader %3; \n\
234 text: root.title; \n\
236 text: root.title; \n\
235 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
237 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
236 horizontalAlignment: root.titleAlignment; \n\
238 horizontalAlignment: root.titleAlignment; \n\
@@ -491,6 +493,7 @@ function cardString(template, components) {
491 var attributesAnchors;
493 var attributesAnchors;
492 var titleContainerAnchors;
494 var titleContainerAnchors;
493 var titleRightAnchor;
495 var titleRightAnchor;
496+ var titleWidth = "undefined";
495 var extraRightAnchor = '';
498 var extraRightAnchor = '';
496 var extraLeftAnchor = '';
499 var extraLeftAnchor = '';
@@ -536,6 +539,7 @@ function cardString(template, components) {
536 } else if (hasMascot) {
539 } else if (hasMascot) {
537 // Using row + titleContainer
540 // Using row + titleContainer
538 titleAnchors = 'verticalCenter: parent.verticalCenter;\n';
541 titleAnchors = 'verticalCenter: parent.verticalCenter;\n';
542+ titleWidth = "parent.width - x";
540 if (headerAsOverlay) {
544 if (headerAsOverlay) {
541 // Using anchors to the overlay
545 // Using anchors to the overlay
@@ -573,7 +577,7 @@ function cardString(template, components) {
574 // code for different elements
578 // code for different elements
575 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
579 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
576− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra);
580+ var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth);
577 var subtitleCode;
581 var subtitleCode;
578 var attributesCode;
582 var attributesCode;