@@ -287,6 +287,7 @@ var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
287287// %2 is used as color of titleLabel
288288// %3 is used as extra condition for visible of titleLabel
289289// %4 is used as title width
290+// %5 is used as horizontal alignment
290291var kTitleLabelCode = 'Label { \n\
291292 id: titleLabel; \n\
292293 objectName: "titleLabel"; \n\
@@ -301,7 +302,7 @@ var kTitleLabelCode = 'Label { \n\
301302 width: %4; \n\
302303 text: root.title; \n\
303304 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
304− horizontalAlignment: root.titleAlignment; \n\
305+ horizontalAlignment: %5; \n\
305306 }\n';
306307
307308// %1 is used as extra anchors of emblemIcon
@@ -422,7 +423,6 @@ function cardString(template, components, isCardTool) {
422423 property string backgroundShapeStyle: "inset"; \n\
423424 property real fontScale: 1.0; \n\
424425 property var scopeStyle: null; \n\
425− property int titleAlignment: Text.AlignLeft; \n\
426426 %2\
427427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
428428 readonly property string title: cardData && cardData["title"] || ""; \n\
@@ -746,9 +746,24 @@ function cardString(template, components, isCardTool) {
746746 }
747747 }
748748
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) {
755+ key = keys[key];
756+ try {
757+ if (typeof components[key] === "string"
758+ || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
759+ } catch (e) {
760+ continue;
761+ }
762+ }
763+
749764 // code for different elements
750765 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);
752767 var subtitleCode;
753768 var attributesCode;
754769