@@ -287,6 +287,7 @@ var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
287// %2 is used as color of titleLabel
287// %2 is used as color of titleLabel
288// %3 is used as extra condition for visible of titleLabel
288// %3 is used as extra condition for visible of titleLabel
289// %4 is used as title width
289// %4 is used as title width
290+// %5 is used as horizontal alignment
290var kTitleLabelCode = 'Label { \n\
291var kTitleLabelCode = 'Label { \n\
291 id: titleLabel; \n\
292 id: titleLabel; \n\
292 objectName: "titleLabel"; \n\
293 objectName: "titleLabel"; \n\
@@ -301,7 +302,7 @@ var kTitleLabelCode = 'Label { \n\
301 width: %4; \n\
302 width: %4; \n\
302 text: root.title; \n\
303 text: root.title; \n\
303 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
304 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
304− horizontalAlignment: root.titleAlignment; \n\
305+ horizontalAlignment: %5; \n\
307// %1 is used as extra anchors of emblemIcon
308// %1 is used as extra anchors of emblemIcon
@@ -422,7 +423,6 @@ function cardString(template, components, isCardTool) {
422 property string backgroundShapeStyle: "inset"; \n\
423 property string backgroundShapeStyle: "inset"; \n\
423 property real fontScale: 1.0; \n\
424 property real fontScale: 1.0; \n\
424 property var scopeStyle: null; \n\
425 property var scopeStyle: null; \n\
425− property int titleAlignment: Text.AlignLeft; \n\
427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
428 readonly property string title: cardData && cardData["title"] || ""; \n\
428 readonly property string title: cardData && cardData["title"] || ""; \n\
@@ -746,9 +746,24 @@ function cardString(template, components, isCardTool) {
749+ var titleAlignment = "Text.AlignHCenter";
750+ if (template["card-layout"] === "horizontal"
751+ || typeof components["title"] !== "object"
752+ || components["title"]["align"] === "left") titleAlignment = "Text.AlignLeft";
753+ var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
754+ for (var key in keys) {
757+ if (typeof components[key] === "string"
758+ || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
749 // code for different elements
764 // code for different elements
750 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
765 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
751− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth);
766+ var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth).arg(titleAlignment);
752 var subtitleCode;
767 var subtitleCode;
753 var attributesCode;
768 var attributesCode;