@@ -129,7 +129,42 @@ ApplicationWindow {
129129 spacing: Style .trayHorizontalMargin
130130 Layout .fillWidth : true
131131 Layout .fillHeight : true
132- delegate: fileActionsDelegate
132+ delegate: ItemDelegate {
133+ id: fileActionsDelegate
134+
135+ required property string name
136+ required property int index
137+ required property string actionIcon
138+
139+ Layout .fillWidth : true
140+ height: implicitHeight
141+ width: parent .width
142+ implicitHeight: Style .activityListButtonHeight
143+ padding: Style .standardSpacing
144+
145+ text: name
146+ font .pixelSize : Style .defaultFontPtSize
147+ Layout .alignment : Qt .AlignLeft | Qt .AlignVCenter
148+ icon {
149+ source: actionIcon
150+ color: palette .windowText
151+ width: Style .minimumActivityItemHeight
152+ height: Style .minimumActivityItemHeight
153+ Layout .alignment : Qt .AlignHCenter | Qt .AlignBottom
154+ }
155+
156+ background: Rectangle {
157+ color: " transparent"
158+ radius: root .windowRadius
159+ border .width : fileActionsDelegate .hovered ? Style .trayWindowBorderWidth : 0
160+ border .color : palette .dark
161+ anchors .margins : Style .standardSpacing
162+ height: parent .height
163+ width: parent .width
164+ }
165+
166+ onClicked: fileActionModel .createRequest (index)
167+ }
133168 }
134169
135170 Button {
@@ -186,79 +221,11 @@ ApplicationWindow {
186221 id: responseArea
187222 anchors .fill : parent
188223 cursorShape: Qt .PointingHandCursor
189- onClicked: Qt .openUrlExternally (fileActionModel .responseUrl )
190- }
191- }
192- }
193- }
194-
195- Component {
196- id: fileActionsDelegate
197-
198- RowLayout {
199- id: fileAction
200- Layout .fillWidth : true
201- height: implicitHeight
202- width: parent .width
203-
204- required property string name
205- required property int index
206- required property string icon
207-
208- Button {
209- id: fileActionButton
210- flat: true
211- Layout .fillWidth : true
212- implicitHeight: Style .activityListButtonHeight
213-
214- padding: Style .standardSpacing
215-
216- contentItem: Row {
217- id: fileActionsContent
218- anchors .fill : parent
219- anchors .topMargin : Style .standardSpacing
220- anchors .rightMargin : Style .standardSpacing
221- anchors .bottomMargin : Style .standardSpacing
222- anchors .leftMargin : Style .extraSmallSpacing
223- spacing: Style .standardSpacing
224- Layout .fillWidth : true
225-
226- Image {
227- source: fileAction .icon + palette .windowText
228- width: Style .minimumActivityItemHeight
229- height: Style .minimumActivityItemHeight
230- fillMode: Image .PreserveAspectFit
231- Layout .preferredWidth : Style .minimumActivityItemHeight
232- Layout .preferredHeight : Style .minimumActivityItemHeight
233- anchors .verticalCenter : parent .verticalCenter
234- }
235-
236- EnforcedPlainTextLabel {
237- text: fileAction .name
238- color: palette .text
239- font .pixelSize : Style .defaultFontPtSize
240- verticalAlignment: Text .AlignVCenter
241- anchors .verticalCenter : parent .verticalCenter
224+ onClicked: {
225+ Qt .openUrlExternally (fileActionModel .responseUrl )
226+ root .close ()
242227 }
243228 }
244-
245- background: Rectangle {
246- color: " transparent"
247- radius: root .windowRadius
248- border .width : fileActionButton .hovered ? Style .trayWindowBorderWidth : 0
249- border .color : palette .dark
250- anchors .margins : Style .standardSpacing
251- height: parent .height
252- width: parent .width
253- }
254-
255- MouseArea {
256- id: fileActionMouseArea
257- anchors .fill : parent
258- anchors .margins : Style .standardSpacing
259- cursorShape: Qt .PointingHandCursor
260- onClicked: fileActionModel .createRequest (fileAction .index )
261- }
262229 }
263230 }
264231 }
0 commit comments