Mercurial > pidgin.yaz
diff src/buddyicon.c @ 10483:748aa3c6de36
[gaim-migrate @ 11773]
scaling for the buddy icons in the tooltips, and whatever else decided to sneak in on this commit
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 08 Jan 2005 07:25:37 +0000 |
parents | a66cf83552dc |
children | f5c9438982f8 |
line wrap: on
line diff
--- a/src/buddyicon.c Fri Jan 07 22:44:01 2005 +0000 +++ b/src/buddyicon.c Sat Jan 08 07:25:37 2005 +0000 @@ -451,3 +451,21 @@ { g_hash_table_destroy(account_cache); } + +void gaim_buddy_icon_get_scale_size(GaimBuddyIconSpec *spec, int *width, int *height) +{ + /* this should eventually get smarter about preserving the aspect + * ratio when scaling, but gimmie a break, I just woke up */ + if(spec && spec->scale_rules & GAIM_ICON_SCALE_DISPLAY) { + if(*width < spec->min_width) + *width = spec->min_width; + else if(*width > spec->max_width) + *width = spec->max_width; + + if(*height < spec->min_height) + *height = spec->min_height; + else if(*height > spec->max_height) + *height = spec->max_height; + } +} +