From 1ace8a21329554efffa1d1185befee021cedd1a7 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 19 Apr 2004 15:17:19 +0000 Subject: Add e-icon-factory.[ch] Use the icon theme via EIconFactory Move 2004-04-16 Michael Terry * Makefile.am: Add e-icon-factory.[ch] * e-gui-utils.c: Use the icon theme via EIconFactory * e-icon-factory.[ch]: Move EIconFactory to e-util, and add icon theme support to the object so evolution uses them svn path=/trunk/; revision=25511 --- e-util/e-gui-utils.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'e-util/e-gui-utils.c') diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c index 9f80610063..40d32de4d1 100644 --- a/e-util/e-gui-utils.c +++ b/e-util/e-gui-utils.c @@ -14,6 +14,7 @@ #include #include "e-gui-utils.h" +#include #include #include @@ -27,25 +28,23 @@ #ifdef HAVE_LIBGNOMEUI_GNOME_ICON_LOOKUP_H #include -#else -#include "art/empty.xpm" #endif GtkWidget *e_create_image_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { - char *filename; GtkWidget *alignment = NULL; if (string1) { GtkWidget *w; + GdkPixbuf *pixbuf; + + pixbuf = e_icon_factory_get_icon (string1, 48); - if (*string1 == '/') - filename = g_strdup(string1); - else - filename = g_build_filename (EVOLUTION_IMAGES, string1, NULL); + w = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); - w = gtk_image_new_from_file (filename); + gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.5); alignment = gtk_widget_new(gtk_alignment_get_type(), "child", w, @@ -56,7 +55,6 @@ GtkWidget *e_create_image_widget(gchar *name, NULL); gtk_widget_show_all (alignment); - g_free (filename); } return alignment; @@ -159,7 +157,7 @@ e_icon_for_mime_type (const char *mime_type, int size_hint) "document-icons/i-regular.png", TRUE, NULL); if (!icon_path) { g_warning ("Could not get any icon for %s!",mime_type); - return gdk_pixbuf_new_from_xpm_data((const char **)empty_xpm); + return e_icon_factory_get_icon (NULL, size_hint); } } #endif -- cgit v1.2.3