Changeset View
Changeset View
Standalone View
Standalone View
src/qml/ListBrowserDelegate.qml
Show All 39 Lines | 26 | FocusScope { | |||
---|---|---|---|---|---|
40 | property bool isSelected | 40 | property bool isSelected | ||
41 | property bool isAlternateColor | 41 | property bool isAlternateColor | ||
42 | property bool detailedView: true | 42 | property bool detailedView: true | ||
43 | 43 | | |||
44 | signal clicked() | 44 | signal clicked() | ||
45 | signal enqueue(var databaseId, var name) | 45 | signal enqueue(var databaseId, var name) | ||
46 | signal replaceAndPlay(var databaseId, var name) | 46 | signal replaceAndPlay(var databaseId, var name) | ||
47 | signal callOpenMetaDataView(var databaseId) | 47 | signal callOpenMetaDataView(var databaseId) | ||
48 | signal resetAlbumImage(var databaseId) | ||||
48 | 49 | | |||
49 | Accessible.role: Accessible.ListItem | 50 | Accessible.role: Accessible.ListItem | ||
50 | Accessible.name: title | 51 | Accessible.name: title | ||
51 | Accessible.description: title | 52 | Accessible.description: title | ||
52 | 53 | | |||
53 | Action { | 54 | Action { | ||
54 | id: enqueueAction | 55 | id: enqueueAction | ||
55 | text: i18nc("Enqueue current track", "Enqueue") | 56 | text: i18nc("Enqueue current track", "Enqueue") | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 182 | layer.effect: DropShadow { | |||
182 | source: coverImageElement | 183 | source: coverImageElement | ||
183 | 184 | | |||
184 | radius: 10 | 185 | radius: 10 | ||
185 | spread: 0.1 | 186 | spread: 0.1 | ||
186 | samples: 21 | 187 | samples: 21 | ||
187 | 188 | | |||
188 | color: myPalette.shadow | 189 | color: myPalette.shadow | ||
189 | } | 190 | } | ||
191 | | ||||
192 | onStatusChanged: { | ||||
193 | if (coverImageElement.status == Image.Error) { | ||||
194 | resetAlbumImage(databaseId) | ||||
195 | } | ||||
196 | } | ||||
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… | |||||
190 | } | 197 | } | ||
191 | } | 198 | } | ||
192 | 199 | | |||
193 | ColumnLayout { | 200 | ColumnLayout { | ||
194 | visible: detailedView | 201 | visible: detailedView | ||
195 | 202 | | |||
196 | Layout.fillWidth: true | 203 | Layout.fillWidth: true | ||
197 | Layout.fillHeight: true | 204 | Layout.fillHeight: true | ||
▲ Show 20 Lines • Show All 247 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?