@@ -67,13 +67,15 @@ DashPreview {
67 id: buttons
67 id: buttons
68 model: genericPreview.previewData.actions
68 model: genericPreview.previewData.actions
70− property int numOfRows: (count + 1) / 2
70+ property int buttonMaxWidth: units.gu(34)
71+ property int numOfColumns: Math.ceil((width + spacing) / (buttonMaxWidth + spacing))
72+ property int numOfRows: Math.ceil(count / numOfColumns)
71 property int spacing: units.gu(1)
73 property int spacing: units.gu(1)
72 height: Math.max(units.gu(4), units.gu(4)*numOfRows + spacing*(numOfRows - 1))
74 height: Math.max(units.gu(4), units.gu(4)*numOfRows + spacing*(numOfRows - 1))
74− cellWidth: Math.max(units.gu(9), width / 2)
76+ cellWidth: width / numOfColumns
75 cellHeight: buttonHeight + spacing
77 cellHeight: buttonHeight + spacing
76− property int buttonWidth: Math.max(0, width / 2 - spacing)
78+ property int buttonWidth: cellWidth - spacing / 2
77 property int buttonHeight: units.gu(4)
79 property int buttonHeight: units.gu(4)
79 delegate: Button {
81 delegate: Button {