From 9169a1d5d4d5ac5d8a14bc021be09a0a80eb9996 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 18 May 2017 17:55:19 +0300 Subject: libslab: correct icon loading code fixes loading app icons from /usr/share/pixmaps when the icon theme doesn't have an icon with chosen name fixes https://github.com/mate-desktop/mate-control-center/issues/283 --- libslab/mate-utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libslab') diff --git a/libslab/mate-utils.c b/libslab/mate-utils.c index 505d5325..c3de6a83 100644 --- a/libslab/mate-utils.c +++ b/libslab/mate-utils.c @@ -55,10 +55,11 @@ load_image_by_id (GtkImage * image, GtkIconSize size, const gchar * image_id) else icon_theme = gtk_icon_theme_get_default (); - icon_exists = gtk_icon_theme_has_icon (icon_theme, id); - - if (icon_exists) - gtk_image_set_from_icon_name (image, id, size); + pixbuf = gtk_icon_theme_load_icon (icon_theme, id, width, 0, NULL); + if (pixbuf != NULL) { + gtk_image_set_from_pixbuf (image, pixbuf); + g_object_unref (pixbuf); + } else gtk_image_set_from_icon_name (image, "image-missing", size); -- cgit v1.2.1