# HG changeset patch # User Eric Warmenhoven # Date 1002840799 0 # Node ID cf3218cd9f948ed68f4972478ead9e43e8f58220 # Parent f9b9251baa413a752e0fe111c59975341a2d4be7 [gaim-migrate @ 2499] handle size changes better. committer: Tailor Script diff -r f9b9251baa41 -r cf3218cd9f94 src/applet.c --- a/src/applet.c Thu Oct 11 21:12:27 2001 +0000 +++ b/src/applet.c Thu Oct 11 22:53:19 2001 +0000 @@ -55,7 +55,7 @@ GdkPixmap *cache; GdkGC *gc; char *path; - GdkPixbuf *pb; + GdkPixbuf *pb, *scale; guchar *dst, *p; double affine[6]; int r,g,b,i; @@ -66,17 +66,18 @@ gdk_gc_copy(gc, applet->style->bg_gc[GTK_WIDGET_STATE(applet)]); path = gnome_pixmap_file(name); - pb = gdk_pixbuf_new_from_file(path); + scale = gdk_pixbuf_new_from_file(path); g_free(path); - if (!pb) + if (!scale) return NULL; + pb = gdk_pixbuf_scale_simple(scale, sizehint, sizehint, GDK_INTERP_HYPER); dst = g_new0(guchar, sizehint*sizehint*3); r = applet->style->bg[GTK_WIDGET_STATE(applet)].red>>8; g = applet->style->bg[GTK_WIDGET_STATE(applet)].green>>8; b = applet->style->bg[GTK_WIDGET_STATE(applet)].blue>>8; p = dst; - for (i = 0; i < 48*48; i++) { + for (i = 0; i < sizehint * sizehint; i++) { *p++ = r; *p++ = g; *p++ = b; @@ -320,11 +321,6 @@ applet_widget_init("GAIM", VERSION, argc, argv, NULL, 0, NULL); - /*init imlib for graphics */ - gdk_imlib_init(); - gtk_widget_push_visual(gdk_imlib_get_visual()); - gtk_widget_push_colormap(gdk_imlib_get_colormap()); - applet = applet_widget_new("gaim_applet"); if (!applet) g_error(_("Can't create GAIM applet!"));