summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-05-18 17:55:19 +0300
committerraveit65 <[email protected]>2017-06-16 15:42:40 +0200
commit457e9331e9d4fb082455ce505c3d3f4bfda9bc38 (patch)
tree4062c285704d8b3155875fcb95b518b60f883140
parent3a4064a9bcc2944bf13ceefe8629e94afc206306 (diff)
downloadmate-control-center-457e9331e9d4fb082455ce505c3d3f4bfda9bc38.tar.bz2
mate-control-center-457e9331e9d4fb082455ce505c3d3f4bfda9bc38.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);