summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-05-18 17:55:19 +0300
committermonsta <[email protected]>2017-05-30 13:26:48 +0300
commit9169a1d5d4d5ac5d8a14bc021be09a0a80eb9996 (patch)
treed5c6a376bce8da1ca18a2659607f79430bc28bce
parent1084b90d3e3d192e7411a3fc536e9e9923ca69f7 (diff)
downloadmate-control-center-9169a1d5d4d5ac5d8a14bc021be09a0a80eb9996.tar.bz2
mate-control-center-9169a1d5d4d5ac5d8a14bc021be09a0a80eb9996.tar.xz
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
-rw-r--r--libslab/mate-utils.c9
1 files changed, 5 insertions, 4 deletions
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);