on xenial help sign in
Force row to be 2GU high and improve invalid value handling
4b1697dMichał Sawicz
plugins/Dash/CardAttributes.qml+3−3
@@ -44,18 +44,18 @@ GridLayout {
44 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
44 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
45 Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
45 Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
46 Layout.fillWidth: true
46 Layout.fillWidth: true
47− height: implicitHeight || units.gu(2)
47+ height: units.gu(2)
48 StatusIcon {
48 StatusIcon {
49 id: icon
49 id: icon
50 height: units.gu(2)
50 height: units.gu(2)
51 sets: ["actions", "status", "apps"]
51 sets: ["actions", "status", "apps"]
52− source: "icon" in modelData ? modelData["icon"] : ""
52+ source: "icon" in modelData && modelData["icon"] || ""
53 }
53 }
54 Label {
54 Label {
55 id: label
55 id: label
56 width: parent.width - x
56 width: parent.width - x
57 anchors.verticalCenter: parent.verticalCenter
57 anchors.verticalCenter: parent.verticalCenter
58− text: "value" in modelData ? modelData["value"] : "";
58+ text: "value" in modelData && modelData["value"] || "";
59 elide: Text.ElideRight
59 elide: Text.ElideRight
60 maximumLineCount: 1
60 maximumLineCount: 1
61 font.weight: "style" in modelData && modelData["style"] == "highlighted" ? Font.DemiBold : Font.Light
61 font.weight: "style" in modelData && modelData["style"] == "highlighted" ? Font.DemiBold : Font.Light