Make sure we always have least have one column in the gridview
Otherwise bad things happen, like bug 1225391
commita5d8cd6c35850249eb61742287a665ecdd5d5980
authorAlbert Astals <albert.astals@canonical.com>
dateMon 23 Sep 2013, 17:58 (13 years ago)
parent6fe2f9b
Components/ResponsiveGridView.qml+1−1
@@ -67,7 +67,7 @@ Item {
6767
6868 function columnsForSpacing(spacing) {
6969 // minimum margin is half of the spacing
70− return Math.floor((parent.width - spacing/2) / (delegateWidth + spacing));
70+ return Math.max(1, Math.floor((parent.width - spacing/2) / (delegateWidth + spacing)));
7171 }
7272
7373 property real allocatableHorizontalSpace: parent.width - columns * delegateWidth