# HG changeset patch # User Richard Laager # Date 1139635752 0 # Node ID cc85a78191ccb2db9efb20522371367a071120c1 # Parent ac5bc9a7b6031bba3bd268bb55050aeb89a23037 [gaim-migrate @ 15585] SF Patch #1428104 from Sadrul Fixes SF Bug #1424843 "This resizes an icon for display when the appropriate flags are set." committer: Tailor Script diff -r ac5bc9a7b603 -r cc85a78191cc src/gtkaccount.c --- a/src/gtkaccount.c Sat Feb 11 05:25:47 2006 +0000 +++ b/src/gtkaccount.c Sat Feb 11 05:29:12 2006 +0000 @@ -193,7 +193,24 @@ set_dialog_icon(AccountPrefsDialog *dialog) { char *filename = gaim_buddy_icons_get_full_path(dialog->icon_path); - gtk_image_set_from_file(GTK_IMAGE(dialog->icon_entry), filename); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + + if (pixbuf && dialog->prpl_info && + (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)) + { + int width, height; + GdkPixbuf *scale; + + gaim_gtk_buddy_icon_get_scale_size(pixbuf, + &dialog->prpl_info->icon_spec, &width, &height); + scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); + + g_object_unref(G_OBJECT(pixbuf)); + pixbuf = scale; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); + g_object_unref(G_OBJECT(pixbuf)); g_free(filename); } @@ -627,7 +644,7 @@ fclose(image); #if GTK_CHECK_VERSION(2,2,0) && !GTK_CHECK_VERSION(2,4,0) - g_object_unref(G_OBJECT(pixbuf)); + g_object_unref(G_OBJECT(pixbuf)); #endif g_free(filename);