From c88a140a7471a911342c3747d506b83c56562c93 Mon Sep 17 00:00:00 2001 From: Thomas James Alexander Thurman Date: Thu, 4 May 2006 16:30:58 +0000 Subject: Bug 113465: allow theme images in themes (er, icon theme images) --- src/theme.c | 34 ++++++++++++++++++++++++---------- 1 file 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 +#include +#include #include #include #include @@ -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); -- cgit v1.2.1