on xenial help sign in
Fix bug in CardTool.titleAlignment
6d7b128Albert Astals Cid
qml/Dash/CardTool.qml+2−2
@@ -144,8 +144,8 @@ Item {
144 */
144 */
145 readonly property int titleAlignment: {
145 readonly property int titleAlignment: {
146 if (template["card-layout"] === "horizontal"
146 if (template["card-layout"] === "horizontal"
147− || (typeof components["title"] !== "object" &&
147+ || typeof components["title"] !== "object"
148− components["title"]["align"] !== "center")) return Text.AlignLeft;
148+ || components["title"]["align"] !== "center") return Text.AlignLeft;
149
149
150 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
150 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
151
151
tests/qmltests/Dash/tst_CardTool.qml+5
@@ -345,6 +345,11 @@ Rectangle {
345 cardTool.componentsChanged();
345 cardTool.componentsChanged();
346
346
347 tryCompare(cardTool, "titleAlignment", data.value);
347 tryCompare(cardTool, "titleAlignment", data.value);
348+
349+ cardTool.components['title'] = { "field": "title", "align": "left" };
350+ cardTool.componentsChanged();
351+
352+ tryCompare(cardTool, "titleAlignment", Text.AlignLeft);
348 }
353 }
349
354
350 function test_categoryLayout_data() {
355 function test_categoryLayout_data() {