@@ -100,9 +100,23 @@ Item {
103− property QtObject priv: card
103+ property var titleAlignment: {
104+ var subtitle = components["subtitle"];
105+ var price = components["price"];
106+ var summary = components["summary"];
108+ var hasSubtitle = subtitle && (typeof subtitle === "string" || subtitle["field"])
109+ var hasPrice = price && (typeof price === "string" || subtitle["field"]);
110+ var hasSummary = summary && (typeof summary === "string" || summary["field"])
112+ var isOnlyTextComponent = !hasSubtitle && !hasPrice && !hasSummary;
113+ if (!isOnlyTextComponent) return Text.AlignLeft;
115+ return (template["card-layout"] === "horizontal") ? Text.AlignHCenter : Text.AlignLeft;
105− property var titleAlignment: card.titleAlignment
119+ property QtObject priv: card
@@ -112,19 +126,6 @@ Item {
112 width: cardTool.cardWidth || implicitWidth
126 width: cardTool.cardWidth || implicitWidth
113 height: cardTool.cardHeight || implicitHeight
127 height: cardTool.cardHeight || implicitHeight
115− property var titleAlignment: {
116− var subtitle = components["subtitle"];
117− var price = components["price"];
119− var hasSubtitle = subtitle && (typeof subtitle === "string" || subtitle["field"])
120− var hasPrice = price && (typeof price === "string" || subtitle["field"]);
122− var isOnlyTextComponent = !hasSubtitle && !hasPrice;
123− if (!isOnlyTextComponent) return Text.AlignLeft;
125− return (template["card-layout"] === "horizontal") ? Text.AlignHCenter : Text.AlignLeft;
128 property var fields: ["art", "mascot", "title", "subtitle", "summary"]
129 property var fields: ["art", "mascot", "title", "subtitle", "summary"]
129 property var maxData: {
130 property var maxData: {
130 "art": Qt.resolvedUrl("graphics/checkers.png"),
131 "art": Qt.resolvedUrl("graphics/checkers.png"),