Changeset View
Changeset View
Standalone View
Standalone View
src/qml/ListBrowserDelegate.qml
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 158 | layer.effect: DropShadow { | |||
---|---|---|---|---|---|
159 | source: coverImageElement | 159 | source: coverImageElement | ||
160 | 160 | | |||
161 | radius: 10 | 161 | radius: 10 | ||
162 | spread: 0.1 | 162 | spread: 0.1 | ||
163 | samples: 21 | 163 | samples: 21 | ||
164 | 164 | | |||
165 | color: myPalette.shadow | 165 | color: myPalette.shadow | ||
166 | } | 166 | } | ||
167 | | ||||
168 | onStatusChanged: { | ||||
169 | if (coverImageElement.status === Image.Error) { | ||||
170 | source = 'image://icon/media-optical-audio' | ||||
171 | } | ||||
172 | } | ||||
astippich: I've been thinking about this a little bit, since I don't like the special handling for the… | |||||
I agree, it is better not to special case for radio. I have been removing the special cases and improving the common code to be able to handle radio correctly without if everywhere. Would it be possible to do some kind of validation directly in the text field ? It might be possible to verify that the URL is well formed and does not do 404. mgallien: I agree, it is better not to special case for radio. I have been removing the special cases and… | |||||
167 | } | 173 | } | ||
168 | } | 174 | } | ||
169 | 175 | | |||
170 | ColumnLayout { | 176 | ColumnLayout { | ||
171 | visible: detailedView | 177 | visible: detailedView | ||
172 | 178 | | |||
173 | Layout.fillWidth: true | 179 | Layout.fillWidth: true | ||
174 | Layout.fillHeight: true | 180 | Layout.fillHeight: true | ||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 305 | LabelWithToolTip { | |||
308 | 314 | | |||
309 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 315 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
310 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 316 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
311 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 317 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
312 | } | 318 | } | ||
313 | } | 319 | } | ||
314 | } | 320 | } | ||
315 | 321 | | |||
322 | Connections { | ||||
323 | target: mediaTrack | ||||
324 | | ||||
325 | onImageUrlChanged: { | ||||
326 | if (coverImageElement.source !== imageUrl) { | ||||
327 | coverImageElement.source = (imageUrl != '' ? imageUrl : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) | ||||
328 | } | ||||
329 | } | ||||
330 | } | ||||
331 | | ||||
316 | states: [ | 332 | states: [ | ||
317 | State { | 333 | State { | ||
318 | name: 'notSelected' | 334 | name: 'notSelected' | ||
319 | when: !mediaTrack.activeFocus && !hoverArea.containsMouse && !mediaTrack.isSelected | 335 | when: !mediaTrack.activeFocus && !hoverArea.containsMouse && !mediaTrack.isSelected | ||
320 | PropertyChanges { | 336 | PropertyChanges { | ||
321 | target: hoverLoader | 337 | target: hoverLoader | ||
322 | active: false | 338 | active: false | ||
323 | } | 339 | } | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |
I've been thinking about this a little bit, since I don't like the special handling for the images here. I think it would actually be much simpler to change the source of the image to the default one in case of an error. This would remove the need for the extra function, and it would actually allow the user to edit the image url (e.g. in case of a typo).
Same in the metadata view.
Does this sound sensible?