@@ -153,55 +153,22 @@ Page {
153
153
}
154
154
}
155
155
156
- delegate: Item {
156
+ delegate: ItemDelegate {
157
157
id: delegate
158
158
required property int nodeId;
159
159
required property string address;
160
160
required property string subversion;
161
161
required property string direction;
162
162
required property string connectionType;
163
163
required property string network;
164
- property color stateColor;
165
- implicitHeight: 60
166
- implicitWidth: listView .width
167
- state: " FILLED"
168
-
169
- states: [
170
- State {
171
- name: " FILLED"
172
- PropertyChanges { target: delegate; stateColor: Theme .color .neutral9 }
173
- },
174
- State {
175
- name: " HOVER"
176
- PropertyChanges { target: delegate; stateColor: Theme .color .orangeLight1 }
177
- },
178
- State {
179
- name: " ACTIVE"
180
- PropertyChanges { target: delegate; stateColor: Theme .color .orange }
181
- }
182
- ]
183
-
184
- MouseArea {
185
- anchors .fill : parent
186
- hoverEnabled: AppMode .isDesktop
187
- onEntered: {
188
- delegate .state = " HOVER"
189
- }
190
- onExited: {
191
- delegate .state = " FILLED"
192
- }
193
- onPressed: {
194
- delegate .state = " ACTIVE"
195
- }
196
- onReleased: {
197
- if (mouseArea .containsMouse ) {
198
- delegate .state = " HOVER"
199
- } else {
200
- delegate .state = " FILLED"
201
- }
164
+ readonly property color stateColor: {
165
+ if (delegate .down ) {
166
+ return Theme .color .orange
167
+ } else if (delegate .hovered ) {
168
+ return Theme .color .orangeLight1
202
169
}
170
+ return Theme .color .neutral9
203
171
}
204
-
205
172
Connections {
206
173
target: peerListModelProxy
207
174
function onSortByChanged (roleName ) {
@@ -254,41 +221,59 @@ Page {
254
221
quaternary .text = subversion
255
222
}
256
223
}
257
-
258
- ColumnLayout {
259
- anchors .left : parent .left
260
- CoreText {
261
- Layout .alignment : Qt .AlignLeft
262
- id: primary
263
- font .pixelSize : 18
264
- color: delegate .stateColor
265
- }
266
- CoreText {
267
- Layout .alignment : Qt .AlignLeft
268
- id: tertiary
269
- font .pixelSize : 15
270
- color: Theme .color .neutral7
224
+ leftPadding: 0
225
+ rightPadding: 0
226
+ topPadding: 0
227
+ bottomPadding: 14
228
+ width: listView .width
229
+ background: Item {
230
+ Separator {
231
+ anchors .bottom : parent .bottom
232
+ width: parent .width
271
233
}
272
234
}
273
- ColumnLayout {
274
- anchors .right : parent .right
275
- CoreText {
276
- Layout .alignment : Qt .AlignRight
277
- id: secondary
278
- font .pixelSize : 18
279
- color: delegate .stateColor
235
+ contentItem: ColumnLayout {
236
+ RowLayout {
237
+ Layout .fillWidth : true
238
+ spacing: 15
239
+ CoreText {
240
+ Layout .alignment : Qt .AlignLeft
241
+ Layout .fillWidth : true
242
+ Layout .preferredWidth : 0
243
+ id: primary
244
+ font .pixelSize : 18
245
+ color: delegate .stateColor
246
+ elide: Text .ElideMiddle
247
+ wrapMode: Text .NoWrap
248
+ horizontalAlignment: Text .AlignLeft
249
+ }
250
+ CoreText {
251
+ Layout .alignment : Qt .AlignRight
252
+ id: secondary
253
+ font .pixelSize : 18
254
+ color: delegate .stateColor
255
+ }
280
256
}
281
- CoreText {
282
- Layout .alignment : Qt .AlignRight
283
- id: quaternary
284
- font .pixelSize : 15
285
- color: Theme .color .neutral7
257
+ RowLayout {
258
+ CoreText {
259
+ Layout .alignment : Qt .AlignLeft
260
+ Layout .fillWidth : true
261
+ Layout .preferredWidth : 0
262
+ id: tertiary
263
+ font .pixelSize : 15
264
+ color: Theme .color .neutral7
265
+ elide: Text .ElideMiddle
266
+ wrapMode: Text .NoWrap
267
+ horizontalAlignment: Text .AlignLeft
268
+ }
269
+ CoreText {
270
+ Layout .alignment : Qt .AlignRight
271
+ id: quaternary
272
+ font .pixelSize : 15
273
+ color: Theme .color .neutral7
274
+ }
286
275
}
287
276
}
288
- Separator {
289
- anchors .bottom : parent .bottom
290
- width: parent .width
291
- }
292
277
}
293
278
}
294
279
}
0 commit comments