Maintain aspect ratio on global icon selector. Fixes #454

Thu, 31 May 2007 20:22:43 +0000

author
Sean Egan <seanegan@pidgin.im>
date
Thu, 31 May 2007 20:22:43 +0000
changeset 17491
f5b75e7f425e
parent 17488
b3d3b6442306
child 17492
d23449c414df
child 17493
533156a7d4e9

Maintain aspect ratio on global icon selector. Fixes #454

pidgin/gtkstatusbox.c file | annotate | diff | comparison | revisions
--- a/pidgin/gtkstatusbox.c	Thu May 31 03:02:13 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Thu May 31 20:22:43 2007 +0000
@@ -2029,6 +2029,10 @@
 	int w, h;
 	GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM);
 	gtk_icon_size_lookup(icon_size, &w, &h);
+	if (height > width)
+		w = width * h  / height;
+	else if (width > height)
+		h = height * w / width;
 	gdk_pixbuf_loader_set_size(loader, w, h);
 #endif
 }

mercurial