# HG changeset patch # User Mark Doliner # Date 1138840410 0 # Node ID 7aea8de78463389bf1895171d5e356a411fdffce # Parent 0aa231ebbfd53ece3a9c2da3540c3c56fc160bbc [gaim-migrate @ 15453] Set a minimum size for the icons overlayed onto stuff committer: Tailor Script diff -r 0aa231ebbfd5 -r 7aea8de78463 src/gtkutils.c --- a/src/gtkutils.c Wed Feb 01 22:38:34 2006 +0000 +++ b/src/gtkutils.c Thu Feb 02 00:33:30 2006 +0000 @@ -1602,13 +1602,25 @@ g_free(filename); if (emblem != NULL) { - int width, height, emblem_width, emblem_height, new_emblem_width, new_emblem_height; + int width, height, emblem_width, emblem_height; + int new_emblem_width, new_emblem_height; + width = gdk_pixbuf_get_width(pixbuf); height = gdk_pixbuf_get_height(pixbuf); emblem_width = gdk_pixbuf_get_width(emblem); emblem_height = gdk_pixbuf_get_height(emblem); - new_emblem_width = width / 2; - new_emblem_height = height / 2; + + /* + * Figure out how big to make the emblem. Normally the emblem + * will have half the width of the pixbuf. But we don't make + * an emblem any smaller than 10 pixels because it becomes + * unrecognizable, unless the width of the pixbuf is less than + * 10 pixels, in which case we make the emblem width the same + * as the pixbuf width. + */ + new_emblem_width = MAX(width / 2, MIN(width, 10)); + new_emblem_height = MAX(height / 2, MIN(height, 10)); + /* Overlay emblem onto the bottom right corner of pixbuf */ gdk_pixbuf_composite(emblem, pixbuf, width - new_emblem_width, height - new_emblem_height,