Mercurial > pidgin.yaz
comparison gtk/gtkblist.c @ 14304:d86ad60af057
[gaim-migrate @ 16994]
If an emblem is really big, scale it down to something sane.
Use a really big emblem (the msn prpl icon) in yahoo.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Wed, 23 Aug 2006 04:29:16 +0000 |
parents | 3248928fbb00 |
children | 2620e491c8f1 |
comparison
equal
deleted
inserted
replaced
14303:d9aa45c10588 | 14304:d86ad60af057 |
---|---|
3012 g_free(image); | 3012 g_free(image); |
3013 emblem = gdk_pixbuf_new_from_file(filename, NULL); | 3013 emblem = gdk_pixbuf_new_from_file(filename, NULL); |
3014 g_free(filename); | 3014 g_free(filename); |
3015 if(emblem) { | 3015 if(emblem) { |
3016 if(i == 0 && size == GAIM_STATUS_ICON_SMALL) { | 3016 if(i == 0 && size == GAIM_STATUS_ICON_SMALL) { |
3017 double scale_factor = 0.6; | |
3018 if(gdk_pixbuf_get_width(emblem) > 20) | |
3019 scale_factor = 9.0 / gdk_pixbuf_get_width(emblem); | |
3020 | |
3017 gdk_pixbuf_composite(emblem, | 3021 gdk_pixbuf_composite(emblem, |
3018 scale, 5, 5, | 3022 scale, 5, 5, |
3019 10, 10, | 3023 10, 10, |
3020 5, 5, | 3024 5, 5, |
3021 .6, .6, | 3025 scale_factor, scale_factor, |
3022 GDK_INTERP_BILINEAR, | 3026 GDK_INTERP_BILINEAR, |
3023 255); | 3027 255); |
3024 } else { | 3028 } else { |
3029 double scale_factor = 1.0; | |
3030 if(gdk_pixbuf_get_width(emblem) > 20) | |
3031 scale_factor = 15.0 / gdk_pixbuf_get_width(emblem); | |
3032 | |
3025 gdk_pixbuf_composite(emblem, | 3033 gdk_pixbuf_composite(emblem, |
3026 scale, emblems[i].x, emblems[i].y, | 3034 scale, emblems[i].x, emblems[i].y, |
3027 15, 15, | 3035 15, 15, |
3028 emblems[i].x, emblems[i].y, | 3036 emblems[i].x, emblems[i].y, |
3029 1, 1, | 3037 scale_factor, scale_factor, |
3030 GDK_INTERP_BILINEAR, | 3038 GDK_INTERP_BILINEAR, |
3031 255); | 3039 255); |
3032 } | 3040 } |
3033 g_object_unref(emblem); | 3041 g_object_unref(emblem); |
3034 } | 3042 } |