mpris: Fall back to app icon first

When no cover art is available, the app icon at least allows
distinguishing between different players, so try falling back
to that before using the generic icon name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2755>
This commit is contained in:
Florian Müllner 2023-04-19 12:54:17 +02:00 committed by Marge Bot
parent 35315a605b
commit 27617ef0a3

View File

@ -70,6 +70,9 @@ class MediaMessage extends MessageList.Message {
let file = Gio.File.new_for_uri(this._player.trackCoverUrl); let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
this._icon.gicon = new Gio.FileIcon({ file }); this._icon.gicon = new Gio.FileIcon({ file });
this._icon.remove_style_class_name('fallback'); this._icon.remove_style_class_name('fallback');
} else if (this._player.app) {
this._icon.gicon = this._player.app.icon;
this._icon.add_style_class_name('fallback');
} else { } else {
this._icon.icon_name = 'audio-x-generic-symbolic'; this._icon.icon_name = 'audio-x-generic-symbolic';
this._icon.add_style_class_name('fallback'); this._icon.add_style_class_name('fallback');