Remove the all-transparent 'unavailable.png' file

We don't need it. Cairo can fade banners without this, so it's just
used for 'missing media' cases. We only hit this case if the default
icon or banner is missing, and  having a fallback image just for that
seems excessive.

We can fail to show the media in the config dialog
by setting the button's pixbuf to None just as well.

I have added a logger error if we even do hit this case, though.
This commit is contained in:
Daniel Johnson 2023-03-25 06:47:02 -04:00
parent 13cb143974
commit 41f81a12db
2 changed files with 2 additions and 9 deletions

View file

@ -72,7 +72,8 @@ def get_pixbuf(path, size):
if pixbuf:
return pixbuf
return get_unavailable_pixbuf(size)
logger.error("The default media '%s' could not be loaded", default_icon)
return None
def get_surface_size(surface):
@ -166,14 +167,6 @@ def get_pixbuf_by_path(path, size=None, preserve_aspect_ratio=True):
logger.error("Unable to load icon from image %s", path)
def get_unavailable_pixbuf(size):
"""Returns an entirely transparent pixbuf of the size given; we use this when
no other image can be loaded, not even the default."""
width, height = size
overlay_path = os.path.join(datapath.get(), "media/unavailable.png")
return GdkPixbuf.Pixbuf.new_from_file_at_scale(overlay_path, width, height, preserve_aspect_ratio=False)
def has_stock_icon(name):
"""This tests if a GTK stock icon is known; if not we can try a fallback."""
if not name:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB