1 Commits
dev ... dev-2

Author SHA1 Message Date
ff9e03e9de mpris_player: never show app icon 2023-12-05 16:44:48 +00:00
2 changed files with 15 additions and 2 deletions

View File

@@ -18,8 +18,9 @@
<object class="GtkImage" id="album_art">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixel-size">96</property>
<property name="use-fallback">False</property>
<property name="pixel-size">48</property>
<property name="icon-name">audio-x-generic-symbolic</property>
<property name="use-fallback">True</property>
<property name="icon_size">0</property>
</object>
<packing>

View File

@@ -272,6 +272,18 @@ namespace SwayNotificationCenter.Widgets.Mpris {
return;
}
}
// Get the app icon
Icon ? icon = null;
if (desktop_entry is DesktopAppInfo) {
icon = desktop_entry.get_icon ();
}
if (icon != null) {
album_art.set_from_gicon (icon, mpris_config.image_size);
} else {
// Default icon
album_art.set_from_icon_name ("audio-x-generic-symbolic",
mpris_config.image_size);
}
}
private void update_button_shuffle (HashTable<string, Variant> metadata) {