diff options
author | Michael Terry <mike@mterry.name> | 2004-04-19 23:17:19 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-04-19 23:17:19 +0800 |
commit | 1ace8a21329554efffa1d1185befee021cedd1a7 (patch) | |
tree | d04b2b464e7471701158856f4880c9e2429800f0 /e-util/e-gui-utils.c | |
parent | e901dd254faf0f505bf2a9d11c8e615a45e6cd64 (diff) | |
download | gsoc2013-evolution-1ace8a21329554efffa1d1185befee021cedd1a7.tar.gz gsoc2013-evolution-1ace8a21329554efffa1d1185befee021cedd1a7.tar.zst gsoc2013-evolution-1ace8a21329554efffa1d1185befee021cedd1a7.zip |
Add e-icon-factory.[ch] Use the icon theme via EIconFactory Move
2004-04-16 Michael Terry <mike@mterry.name>
* 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
Diffstat (limited to 'e-util/e-gui-utils.c')
-rw-r--r-- | e-util/e-gui-utils.c | 18 |
1 files changed, 8 insertions, 10 deletions
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 <string.h> #include "e-gui-utils.h" +#include <e-util/e-icon-factory.h> #include <glib.h> #include <gtk/gtkalignment.h> @@ -27,25 +28,23 @@ #ifdef HAVE_LIBGNOMEUI_GNOME_ICON_LOOKUP_H #include <libgnomeui/gnome-icon-lookup.h> -#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 |