on xenial help sign in
Revert workarounds.

Add maxData for attributes to CardTool.

commit13581a669f0bae421516ea54a35fa982903e6f8e authorYing-Chun Liu <paul.liu@canonical.com> dateThu 24 Jul 2014, 22:51 (12 years ago) parent4a9c732
3 files changed+5−3
plugins/Dash/CardCreator.js+1−1 qml/Dash/CardTool.qml+3−2 tests/qmltests/Dash/tst_Card.qml+1
plugins/Dash/CardCreator.js+1−1
@@ -576,7 +576,7 @@ function cardString(template, components) {
576576 } else if (hasMascot) {
577577 code += 'implicitHeight: mascotImage.y + mascotImage.height;\n';
578578 } else if (hasAttributes) {
579− code += 'implicitHeight: attributesRow.y + Math.max(attributesRow.height, attributesRow.childrenRect.height, attributesRow.implicitHeight, units.gu(2)) + units.gu(1);\n';
579+ code += 'implicitHeight: attributesRow.y + attributesRow.height + units.gu(1);\n';
580580 } else if (hasSubtitle) {
581581 code += 'implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
582582 } else if (hasTitle) {
qml/Dash/CardTool.qml+3−2
@@ -167,13 +167,14 @@ Item {
167167
168168 Loader {
169169 id: cardLoader
170− property var fields: ["art", "mascot", "title", "subtitle", "summary"]
170+ property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"]
171171 property var maxData: {
172172 "art": Qt.resolvedUrl("graphics/checkers.png"),
173173 "mascot": Qt.resolvedUrl("graphics/checkers.png"),
174174 "title": "—\n—",
175175 "subtitle": "—",
176− "summary": "—\n—\n—\n—\n—"
176+ "summary": "—\n—\n—\n—\n—",
177+ "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"},{"value":"text3","icon":"image://theme/ok"}]
177178 }
178179 sourceComponent: cardTool.cardComponent
179180 onLoaded: {
tests/qmltests/Dash/tst_Card.qml+1
@@ -111,6 +111,7 @@ Rectangle {
111111 anchors { top: parent.top; left: parent.left; margins: units.gu(1) }
112112
113113 sourceComponent: cardTool.cardComponent
114+ clip: true
114115 onLoaded: {
115116 item.template = Qt.binding(function() { return cardTool.template; });
116117 item.components = Qt.binding(function() { return cardTool.components; });