@@ -275,6 +275,7 @@ var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
275275// %2 is used as color of titleLabel
276276// %3 is used as extra condition for visible of titleLabel
277277// %4 is used as title width
278+// %5 is used as horizontal alignment
278279var kTitleLabelCode = 'Label { \n\
279280 id: titleLabel; \n\
280281 objectName: "titleLabel"; \n\
@@ -289,7 +290,7 @@ var kTitleLabelCode = 'Label { \n\
289290 width: %4; \n\
290291 text: root.title; \n\
291292 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
292− horizontalAlignment: root.titleAlignment; \n\
293+ horizontalAlignment: %5; \n\
293294 }\n';
294295
295296// %1 is used as extra anchors of emblemIcon
@@ -410,7 +411,6 @@ function cardString(template, components) {
410411 property string backgroundShapeStyle: "inset"; \n\
411412 property real fontScale: 1.0; \n\
412413 property var scopeStyle: null; \n\
413− property int titleAlignment: Text.AlignLeft; \n\
414414 property int fixedHeaderHeight: -1; \n\
415415 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
416416 readonly property string title: cardData && cardData["title"] || ""; \n\
@@ -715,9 +715,24 @@ function cardString(template, components) {
715715 }
716716 }
717717
718+ var titleAlignment = "Text.AlignHCenter";
719+ if (template["card-layout"] === "horizontal"
720+ || typeof components["title"] !== "object"
721+ || components["title"]["align"] === "left") titleAlignment = "Text.AlignLeft";
722+ var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
723+ for (var key in keys) {
724+ key = keys[key];
725+ try {
726+ if (typeof components[key] === "string"
727+ || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
728+ } catch (e) {
729+ continue;
730+ }
731+ }
732+
718733 // code for different elements
719734 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
720− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth);
735+ var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth).arg(titleAlignment);
721736 var subtitleCode;
722737 var attributesCode;
723738