on xenial help sign in
fix buttons in AppPreview
commit196037b0a81469e6670dedfb502ea1497e44fdcc authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 1 Oct 2013, 19:24 (13 years ago) parentc413c32
1 file changed+15−23
Dash/Apps/AppPreview.qml+15−23
Dash/Apps/AppPreview.qml+15−23
@@ -79,30 +79,22 @@ GenericPreview {
7979 Component {
8080 id: buttonsComponent
8181
82− GridView {
83− id: buttonsGrid
82+ Column {
83+ id: buttonList
8484 objectName: "gridButtons"
85−
86− model: root.previewData.actions
87−
88− property int numOfRows: (count + 1) / 2
89− property int spacing: units.gu(1)
90− height: Math.max(units.gu(5), units.gu(5)*numOfRows + spacing*(numOfRows - 1))
91−
92− interactive: false
93− cellWidth: Math.max(units.gu(9), width / 2)
94− cellHeight: buttonHeight + spacing
95− property int buttonWidth: count > 1 ? Math.max(0, width / 2 - spacing) : width
96− property int buttonHeight: units.gu(5)
97−
98− delegate: Button {
99− width: Math.max(units.gu(4), buttonsGrid.buttonWidth)
100− height: buttonsGrid.buttonHeight
101− color: Theme.palette.selected.foreground
102− text: modelData.displayName
103− iconSource: modelData.iconHint
104− iconPosition: "right"
105− onClicked: root.previewData.execute(modelData.id, { })
85+ spacing: units.gu(1)
86+ Repeater {
87+ model: root.previewData.actions
88+
89+ delegate: Button {
90+ width: parent.width
91+ height: buttonList.buttonHeight
92+ color: Theme.palette.selected.foreground
93+ text: modelData.displayName
94+ iconSource: modelData.iconHint
95+ iconPosition: "right"
96+ onClicked: root.previewData.execute(modelData.id, { })
97+ }
10698 }
10799 }
108100 }