on xenial help sign in
Fix CardHeader height with no attributes.
commit971892c411d2edf75794adeb81611cff60f43492 authorMichał Sawicz <michal.sawicz@canonical.com> dateMon 27 Jan 2014, 22:22 (13 years ago) parente51a137
2 files changed+9−1
qml/Dash/CardHeader.qml+3 tests/qmltests/Dash/tst_CardHeader.qml+6−1
qml/Dash/CardHeader.qml+3
@@ -90,6 +90,7 @@ Item {
9090 elide: Text.ElideRight
9191 font.weight: Font.DemiBold
9292 color: Theme.palette.selected.foreground
93+ visible: text
9394 }
9495
9596 Label {
@@ -98,6 +99,7 @@ Item {
9899 width: parent.labelWidth
99100 elide: Text.ElideRight
100101 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
102+ visible: text
101103 }
102104
103105 Label {
@@ -105,6 +107,7 @@ Item {
105107 width: parent.labelWidth
106108 elide: Text.ElideRight
107109 horizontalAlignment: Text.AlignRight
110+ visible: text
108111 }
109112 }
110113 }
tests/qmltests/Dash/tst_CardHeader.qml+6−1
@@ -121,7 +121,8 @@ Rectangle {
121121 function test_dimensions_data() {
122122 return [
123123 { 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 } }
125126 ]
126127 }
127128
@@ -133,6 +134,10 @@ Rectangle {
133134 if (data.hasOwnProperty("width")) {
134135 tryCompare(data.object, "width", data.width);
135136 }
137+
138+ if (data.hasOwnProperty("height")) {
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
140+ }
136141 }
137142 }
138143}