on xenial help sign in
fix tests
45d87c3Albert Astals
qml/Dash/CardHeader.qml+4−4
@@ -19,7 +19,7 @@ import Ubuntu.Components 0.1
19
19
20Item {
20Item {
21 id: root
21 id: root
22− property var mascot
22+ property url mascot: ""
23 property alias title: titleLabel.text
23 property alias title: titleLabel.text
24 property var subtitle
24 property var subtitle
25
25
@@ -35,7 +35,7 @@ Item {
35 property bool useMascotShape: true
35 property bool useMascotShape: true
36 property color fontColor: Theme.palette.selected.backgroundText
36 property color fontColor: Theme.palette.selected.backgroundText
37
37
38− visible: mascot || title
38+ visible: mascot != "" || title
39 implicitHeight: row.height > 0 ? row.height + row.margins * 2 : 0
39 implicitHeight: row.height > 0 ? row.height + row.margins * 2 : 0
40
40
41 Row {
41 Row {
@@ -71,8 +71,8 @@ Item {
71
71
72 Loader {
72 Loader {
73 id: mascotImageLoader
73 id: mascotImageLoader
74− active: root.mascot
74+ active: root.mascot != ""
75− visible: root.mascot && !useMascotShape && item.status === Image.Ready
75+ visible: active && !useMascotShape && item.status === Image.Ready
76 anchors.verticalCenter: parent.verticalCenter
76 anchors.verticalCenter: parent.verticalCenter
77 sourceComponent: Image {
77 sourceComponent: Image {
78 objectName: "mascotImage"
78 objectName: "mascotImage"
tests/qmltests/Dash/tst_Card.qml+1−1
@@ -207,7 +207,7 @@ Rectangle {
207
207
208 function test_header_binding_data() {
208 function test_header_binding_data() {
209 return [
209 return [
210− { tag: "Mascot", property: "mascot", value: "../../tests/qmltests/Dash/artwork/avatar.png", index: 0 },
210+ { tag: "Mascot", property: "mascot", value: Qt.resolvedUrl("artwork/avatar.png"), index: 0 },
211 { tag: "Title", property: "title", value: "foo", index: 0 },
211 { tag: "Title", property: "title", value: "foo", index: 0 },
212 { tag: "Subtitle", property: "subtitle", value: "bar", index: 0 },
212 { tag: "Subtitle", property: "subtitle", value: "bar", index: 0 },
213 ];
213 ];
tests/qmltests/Dash/tst_CardHeader.qml+1−1
@@ -43,7 +43,7 @@ Rectangle {
43
43
44 when: windowShown
44 when: windowShown
45
45
46− property Item mascot: findChild(cardHeader, "mascotShape")
46+ property Item mascot: findChild(cardHeader, "mascotShapeLoader")
47 property Item titleLabel: findChild(cardHeader, "titleLabel")
47 property Item titleLabel: findChild(cardHeader, "titleLabel")
48 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
48 property Item subtitleLabel: findChild(cardHeader, "subtitleLabel")
49 property Item oldPriceLabel: findChild(cardHeader, "oldPriceLabel")
49 property Item oldPriceLabel: findChild(cardHeader, "oldPriceLabel")