aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-gui-utils.c40
2 files changed, 16 insertions, 29 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index ffca5638f1..756e381004 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-09 Chris Toshok <toshok@ximian.com>
+
+ * e-gui-utils.c (e_create_image_widget): change this to use
+ GtkImage instead of GnomeCanvas.
+
2003-01-08 Ettore Perazzoli <ettore@ximian.com>
* Makefile.am: Images are now in $(datadir)/evolution/images
diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c
index b7be21a6d9..892f97a064 100644
--- a/e-util/e-gui-utils.c
+++ b/e-util/e-gui-utils.c
@@ -13,53 +13,35 @@
#include "e-gui-utils.h"
#include <glib.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkalignment.h>
-#include <libgnome/gnome-util.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
+#include <gtk/gtkimage.h>
GtkWidget *e_create_image_widget(gchar *name,
gchar *string1, gchar *string2,
gint int1, gint int2)
{
char *filename;
- GdkPixbuf *pixbuf;
- double width, height;
- GtkWidget *canvas, *alignment;
+ GtkWidget *alignment = NULL;
if (string1) {
+ GtkWidget *w;
+
if (*string1 == '/')
filename = g_strdup(string1);
else
- filename = g_concat_dir_and_file(EVOLUTION_IMAGES, string1);
- pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
- width = gdk_pixbuf_get_width(pixbuf);
- height = gdk_pixbuf_get_height(pixbuf);
+ filename = g_build_filename (EVOLUTION_IMAGES, string1, NULL);
- canvas = gnome_canvas_new_aa();
- GTK_OBJECT_UNSET_FLAGS(GTK_WIDGET(canvas), GTK_CAN_FOCUS);
- gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas)),
- gnome_canvas_pixbuf_get_type(),
- "pixbuf", pixbuf,
- NULL);
+ w = gtk_image_new_from_file (filename);
alignment = gtk_widget_new(gtk_alignment_get_type(),
- "child", canvas,
+ "child", w,
"xalign", (double) 0,
"yalign", (double) 0,
"xscale", (double) 0,
"yscale", (double) 0,
NULL);
-
- gtk_widget_set_usize(canvas, width, height);
-
- gdk_pixbuf_unref(pixbuf);
- gtk_widget_show(canvas);
- gtk_widget_show(alignment);
- g_free(filename);
+ gtk_widget_show_all (alignment);
+ g_free (filename);
+ }
- return alignment;
- } else
- return NULL;
+ return alignment;
}