on xenial help sign in
CardAttributes: Specify column and row since the gridlayout gets confused sometimes
65bdb6dAlbert Astals
plugins/Dash/CardAttributes.qml+2
@@ -41,6 +41,8 @@ GridLayout {
41 if (column == grid.columns - 1 || index == repeater.count - 1) return Qt.AlignRight;
41 if (column == grid.columns - 1 || index == repeater.count - 1) return Qt.AlignRight;
42 if (column == 1) return Qt.AlignHCenter;
42 if (column == 1) return Qt.AlignHCenter;
43 }
43 }
44+ Layout.column: index % grid.columns
45+ Layout.row: index / grid.columns
44 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
46 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
45 Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
47 Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
46 Layout.fillWidth: true
48 Layout.fillWidth: true
tests/qmltests/Dash/tst_Card.qml+13
@@ -186,6 +186,19 @@ Rectangle {
186 height: units.gu(4)
186 height: units.gu(4)
187 color: "orange"
187 color: "orange"
188 }
188 }
189+
190+ Rectangle {
191+ color: "red"
192+ anchors { left: parent.left; right: parent.right }
193+ height: units.gu(4)
194+ Label {
195+ text: "Toggle Visible"
196+ }
197+ MouseArea {
198+ anchors.fill: parent
199+ onClicked: loader.visible = !loader.visible
200+ }
201+ }
189 }
202 }
190 }
203 }
191
204