comparison gtk/gtkconv.c @ 15222:26357b7f117e

[gaim-migrate @ 18012] * Get rid of an assertion failure that I think was happening when you added a new account without setting a custom icon for it, and you still had the Accounts window open * A little code-reuse in some buddy icon scaling code * An minor memleak that could happen when unable open a new file in $HOME/.gaim/icons/ committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 17 Dec 2006 05:04:23 +0000
parents ae5eb8de9574
children 9a44dd7955d6
comparison
equal deleted inserted replaced
15221:3043806ad900 15222:26357b7f117e
2306 g_idle_add(reset_auto_resize_cb, gtkconv); 2306 g_idle_add(reset_auto_resize_cb, gtkconv);
2307 2307
2308 gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL); 2308 gdk_pixbuf_animation_iter_advance(gtkconv->u.im->iter, NULL);
2309 buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); 2309 buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter);
2310 2310
2311 gaim_gtk_buddy_icon_get_scale_size(buf, prpl_info ? &prpl_info->icon_spec : 2311 if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)
2312 NULL, &scale_width, &scale_height); 2312 gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec,
2313 &scale_width, &scale_height);
2313 2314
2314 /* this code is ugly, and scares me */ 2315 /* this code is ugly, and scares me */
2315 scale = gdk_pixbuf_scale_simple(buf, 2316 scale = gdk_pixbuf_scale_simple(buf,
2316 MAX(gdk_pixbuf_get_width(buf) * scale_width / 2317 MAX(gdk_pixbuf_get_width(buf) * scale_width /
2317 gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1), 2318 gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1),
6022 buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter); 6023 buf = gdk_pixbuf_animation_iter_get_pixbuf(gtkconv->u.im->iter);
6023 if (gtkconv->u.im->animate) 6024 if (gtkconv->u.im->animate)
6024 start_anim(NULL, gtkconv); 6025 start_anim(NULL, gtkconv);
6025 } 6026 }
6026 6027
6027 gaim_gtk_buddy_icon_get_scale_size(buf, prpl_info ? &prpl_info->icon_spec : 6028 if (prpl_info && prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)
6028 NULL, &scale_width, &scale_height); 6029 gaim_gtk_buddy_icon_get_scale_size(buf, &prpl_info->icon_spec,
6030 &scale_width, &scale_height);
6029 scale = gdk_pixbuf_scale_simple(buf, 6031 scale = gdk_pixbuf_scale_simple(buf,
6030 MAX(gdk_pixbuf_get_width(buf) * scale_width / 6032 MAX(gdk_pixbuf_get_width(buf) * scale_width /
6031 gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1), 6033 gdk_pixbuf_animation_get_width(gtkconv->u.im->anim), 1),
6032 MAX(gdk_pixbuf_get_height(buf) * scale_height / 6034 MAX(gdk_pixbuf_get_height(buf) * scale_height /
6033 gdk_pixbuf_animation_get_height(gtkconv->u.im->anim), 1), 6035 gdk_pixbuf_animation_get_height(gtkconv->u.im->anim), 1),