@@ -85,8 +85,8 @@ Rectangle {
85 "layout": { "template": { "card-layout": "vertical" }, "components": { "title": "title", "subtitle": "subtitle" } }
85 "layout": { "template": { "card-layout": "vertical" }, "components": { "title": "title", "subtitle": "subtitle" } }
88− "name": "Title, price - horizontal",
88+ "name": "Title, attributes - horizontal",
89− "layout": { "template": { "card-layout": "horizontal" }, "components": { "title": "title", "price": "price" } }
89+ "layout": { "template": { "card-layout": "horizontal" }, "components": { "title": "title", "attributes": "attributes" } }
@@ -100,6 +100,7 @@ Rectangle {
103 width: units.gu(38)
104 width: units.gu(38)
104 anchors { left: parent.left; top: parent.top; margins: units.gu(1) }
105 anchors { left: parent.left; top: parent.top; margins: units.gu(1) }
@@ -111,7 +112,7 @@ Rectangle {
113 delegate: Row {
114 delegate: Row {
114− anchors { left: parent.left; right: parent.right; margins: units.gu(3) }
115+ anchors { left: column.left; right: column.right; margins: units.gu(3) }
117 height: units.gu(5)
118 height: units.gu(5)
@@ -315,28 +316,35 @@ Rectangle {
318− function test_card_header_component_alignment_data() {
319+ function test_card_title_alignment_data() {
320− { tag: "Title - vertical", component: "titleLabel", property: "headerAlignment",
321+ { tag: "Art, header, summary", value: Text.AlignLeft, index: 0 },
322+ { tag: "Header, summary", value: Text.AlignLeft, index: 1 },
323+ { tag: "Art, header", value: Text.AlignLeft, index: 2 },
324+ { tag: "Header only", value: Text.AlignLeft, index: 3 },
325+ { tag: "Header title only", value: Text.AlignHCenter, index: 4 },
326+ { tag: "Header title and subtitle", value: Text.AlignLeft, index: 5 },
327+ { tag: "Header title and mascot", value: Text.AlignLeft, index: 6 },
328+ { tag: "Art, header, summary - small", value: Text.AlignLeft, index: 7 },
329+ { tag: "Art, header, summary - large", value: Text.AlignLeft, index: 8 },
330+ { tag: "Art, header, summary - horizontal", value: Text.AlignLeft, index: 9 },
331+ { tag: "Art, header - portrait", value: Text.AlignLeft, index: 10 },
321− value: Text.AlignHCenter, index: 11, layout_index: 0 },
332+ { tag: "Title - vertical", value: Text.AlignHCenter, index: 11 },
322− { tag: "Title - horizontal", component: "titleLabel", property: "headerAlignment",
323− value: Text.AlignLeft, index: 12, layout_index: 0},
333+ { tag: "Title - horizontal", value: Text.AlignLeft, index: 12 },
324− { tag: "Title, subtitle - vertical", component: "titleLabel", property: "headerAlignment",
325− value: Text.AlignLeft, index: 13, layout_index: 0},
334+ { tag: "Title, subtitle - vertical", value: Text.AlignLeft, index: 13 },
326− { tag: "Title, price - horizontal", component: "titleLabel", property: "headerAlignment",
327− value: Text.AlignLeft, index: 14, layout_index: 0},
335+ { tag: "Title, attributes - horizontal", value: Text.AlignLeft, index: 14 },
331− function test_card_header_component_alignment(data) {
339+ function test_card_title_alignment(data) {
332 selector.selectedIndex = data.index;
340 selector.selectedIndex = data.index;
333− if (data.hasOwnProperty("layout_index")) {
334− layoutSelector.selectedIndex = data.layout_index;
337− if (data.hasOwnProperty("property")) {
342+ tryCompare(cardTool, "titleAlignment", Text.AlignLeft);
338− tryCompare(cardTool, data.property, data.value);
343+
339− }
344+ cardTool.components['title'] = { "field": "title", "align": "center" };
345+ cardTool.componentsChanged();
347+ tryCompare(cardTool, "titleAlignment", data.value);
342 function test_categoryLayout_data() {
350 function test_categoryLayout_data() {