diff options
Diffstat (limited to 'src/theme.c')
-rw-r--r-- | src/theme.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/theme.c b/src/theme.c index a9755759..b915e4d6 100644 --- a/src/theme.c +++ b/src/theme.c @@ -25,6 +25,8 @@ #include "util.h" #include "gradient.h" #include <gtk/gtkwidget.h> +#include <gtk/gtkimage.h> +#include <gtk/gtkicontheme.h> #include <string.h> #include <stdlib.h> #include <math.h> @@ -4620,19 +4622,31 @@ meta_theme_load_image (MetaTheme *theme, if (pixbuf == NULL) { - char *full_path; - - full_path = g_build_filename (theme->dirname, filename, NULL); - - pixbuf = gdk_pixbuf_new_from_file (full_path, error); - if (pixbuf == NULL) + + if (g_str_has_prefix (filename, "theme:")) { - g_free (full_path); - return NULL; - } + pixbuf = gtk_icon_theme_load_icon ( + gtk_icon_theme_get_default (), + filename+6, + 48, + 0, + error); + if (pixbuf == NULL) return NULL; + } + else + { + char *full_path; + full_path = g_build_filename (theme->dirname, filename, NULL); - g_free (full_path); + pixbuf = gdk_pixbuf_new_from_file (full_path, error); + if (pixbuf == NULL) + { + g_free (full_path); + return NULL; + } + g_free (full_path); + } g_hash_table_replace (theme->images_by_filename, g_strdup (filename), pixbuf); |