diff --git a/mcg/widgets.py b/mcg/widgets.py index 03278c6..f074abc 100644 --- a/mcg/widgets.py +++ b/mcg/widgets.py @@ -1123,7 +1123,7 @@ class CoverPanel(GObject.GObject): self._cover_spinner.start() if not current_album or not new_album or current_album != new_album: url = new_album.get_cover() if new_album else None - if url and url is not "": + if url: # Load image and draw it self._cover_pixbuf = Utils.load_cover(url) else: @@ -1477,13 +1477,13 @@ class PlaylistPanel(GObject.GObject): self._standalone_stack.set_visible_child(self._standalone_spinner) self._standalone_spinner.start() url = album.get_cover() - if url is not None and url is not "": + if url: # Load image and draw it self._standalone_pixbuf = Utils.load_cover(url) - self._resize_standalone_image() else: # Reset image - self._standalone_image.clear() + self._standalone_pixbuf = self._get_default_image() + self._resize_standalone_image() self._standalone_stack.set_visible_child(self._standalone_scroll) self._standalone_spinner.stop() @@ -1515,6 +1515,14 @@ class PlaylistPanel(GObject.GObject): self._standalone_image.show() + def _get_default_image(self): + return self._icon_theme.load_icon( + Window.STOCK_ICON_DEFAULT, + 512, + Gtk.IconLookupFlags.FORCE_SVG & Gtk.IconLookupFlags.FORCE_SIZE + ) + + class LibraryPanel(GObject.GObject): @@ -2009,13 +2017,13 @@ class LibraryPanel(GObject.GObject): self._standalone_stack.set_visible_child(self._standalone_spinner) self._standalone_spinner.start() url = album.get_cover() - if url is not None and url is not "": + if url: # Load image and draw it self._standalone_pixbuf = Utils.load_cover(url) - self._resize_standalone_image() else: # Reset image - self._standalone_image.clear() + self._standalone_pixbuf = self._get_default_image() + self._resize_standalone_image() self._standalone_stack.set_visible_child(self._standalone_scroll) self._standalone_spinner.stop() @@ -2050,7 +2058,7 @@ class LibraryPanel(GObject.GObject): def _get_default_image(self): return self._icon_theme.load_icon( Window.STOCK_ICON_DEFAULT, - 64, + 512, Gtk.IconLookupFlags.FORCE_SVG & Gtk.IconLookupFlags.FORCE_SIZE )