on xenial help sign in
fix buttons in AppPreview
196037bMichael Zanetti
Dash/Apps/AppPreview.qml+15−23
@@ -79,30 +79,22 @@ GenericPreview {
79 Component {
79 Component {
80 id: buttonsComponent
80 id: buttonsComponent
81
81
82− GridView {
82+ Column {
83− id: buttonsGrid
83+ id: buttonList
84 objectName: "gridButtons"
84 objectName: "gridButtons"
85−
85+ spacing: units.gu(1)
86+ Repeater {
86− model: root.previewData.actions
87+ model: root.previewData.actions
87−
88+
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 {
89+ delegate: Button {
99− width: Math.max(units.gu(4), buttonsGrid.buttonWidth)
90+ width: parent.width
100− height: buttonsGrid.buttonHeight
91+ height: buttonList.buttonHeight
101− color: Theme.palette.selected.foreground
92+ color: Theme.palette.selected.foreground
102− text: modelData.displayName
93+ text: modelData.displayName
103− iconSource: modelData.iconHint
94+ iconSource: modelData.iconHint
104− iconPosition: "right"
95+ iconPosition: "right"
105− onClicked: root.previewData.execute(modelData.id, { })
96+ onClicked: root.previewData.execute(modelData.id, { })
97+ }
106 }
98 }
107 }
99 }
108 }
100 }