on xenial help sign in
Fix CardHeader height with no attributes.
971892cMichał Sawicz
qml/Dash/CardHeader.qml+3
@@ -90,6 +90,7 @@ Item {
90 elide: Text.ElideRight
90 elide: Text.ElideRight
91 font.weight: Font.DemiBold
91 font.weight: Font.DemiBold
92 color: Theme.palette.selected.foreground
92 color: Theme.palette.selected.foreground
93+ visible: text
93 }
94 }
94
95
95 Label {
96 Label {
@@ -98,6 +99,7 @@ Item {
98 width: parent.labelWidth
99 width: parent.labelWidth
99 elide: Text.ElideRight
100 elide: Text.ElideRight
100 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
101 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
102+ visible: text
101 }
103 }
102
104
103 Label {
105 Label {
@@ -105,6 +107,7 @@ Item {
105 width: parent.labelWidth
107 width: parent.labelWidth
106 elide: Text.ElideRight
108 elide: Text.ElideRight
107 horizontalAlignment: Text.AlignRight
109 horizontalAlignment: Text.AlignRight
110+ visible: text
108 }
111 }
109 }
112 }
110 }
113 }
tests/qmltests/Dash/tst_CardHeader.qml+6−1
@@ -121,7 +121,8 @@ Rectangle {
121 function test_dimensions_data() {
121 function test_dimensions_data() {
122 return [
122 return [
123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
124− { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" }
124+ { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
125+ { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } }
125 ]
126 ]
126 }
127 }
127
128
@@ -133,6 +134,10 @@ Rectangle {
133 if (data.hasOwnProperty("width")) {
134 if (data.hasOwnProperty("width")) {
134 tryCompare(data.object, "width", data.width);
135 tryCompare(data.object, "width", data.width);
135 }
136 }
137+
138+ if (data.hasOwnProperty("height")) {
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
140+ }
136 }
141 }
137 }
142 }
138}
143}