CardAttributes: Specify column and row since the gridlayout gets confused sometimes
Fixes: 1381092
Approved by: Michał Sawicz, PS Jenkins bot
commit65bdb6d9f22ccc788ad4e77efa57e9bedfa09f20
authorAlbert Astals <albert.astals@canonical.com>
dateThu 30 Oct 2014, 10:50 (12 years ago)
parent04fcea593e654d
plugins/Dash/CardAttributes.qml+2
@@ -41,6 +41,8 @@ GridLayout {
4141 if (column == grid.columns - 1 || index == repeater.count - 1) return Qt.AlignRight;
4242 if (column == 1) return Qt.AlignHCenter;
4343 }
44+ Layout.column: index % grid.columns
45+ Layout.row: index / grid.columns
4446 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
4547 Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
4648 Layout.fillWidth: true
tests/qmltests/Dash/tst_Card.qml+13
@@ -186,6 +186,19 @@ Rectangle {
186186 height: units.gu(4)
187187 color: "orange"
188188 }
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+ }
189202 }
190203 }
191204