Mercurial > pidgin
changeset 2486:cf3218cd9f94
[gaim-migrate @ 2499]
handle size changes better.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 11 Oct 2001 22:53:19 +0000 |
parents | f9b9251baa41 |
children | 43a75ca5b909 |
files | src/applet.c |
diffstat | 1 files changed, 5 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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!"));