# HG changeset patch # User nenolod # Date 1150694096 25200 # Node ID ead95abdf9bcda240695c01bf3784e3131aeeef2 # Parent 61b576d80cbb9eecba2e3ce16cf91e5b54a8a3f5 [svn] - downsize images larger than 150px diff -r 61b576d80cbb -r ead95abdf9bc ChangeLog --- a/ChangeLog Sun Jun 18 21:52:46 2006 -0700 +++ b/ChangeLog Sun Jun 18 22:14:56 2006 -0700 @@ -1,3 +1,12 @@ +2006-06-19 04:52:46 +0000 Derek Pomery + revision [1508] + nitpicks, whee! just so I can see the popup when snapped against screen edge. + + + Changes: Modified: + +5 -2 trunk/audacious/ui_fileinfo.c + + 2006-06-19 04:45:20 +0000 William Pitcock revision [1506] - la la la, resize diff -r 61b576d80cbb -r ead95abdf9bc audacious/ui_fileinfo.c --- a/audacious/ui_fileinfo.c Sun Jun 18 21:52:46 2006 -0700 +++ b/audacious/ui_fileinfo.c Sun Jun 18 22:14:56 2006 -0700 @@ -101,11 +101,24 @@ { GladeXML *xml = g_object_get_data(G_OBJECT(fileinfo_win), "glade-xml"); GtkWidget *widget = glade_xml_get_widget(xml, entry); + GdkPixbuf *pixbuf; if (xml == NULL || widget == NULL) return; - gtk_image_set_from_file(GTK_IMAGE(widget), text); + pixbuf = gdk_pixbuf_new_from_file(text, NULL); + + if (pixbuf == NULL) + return; + + if (gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf)) > 150) + { + GdkPixbuf *pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), 150, 150, GDK_INTERP_BILINEAR); + g_object_unref(G_OBJECT(pixbuf)); + pixbuf = pixbuf2; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf)); } static void @@ -125,11 +138,24 @@ { GladeXML *xml = g_object_get_data(G_OBJECT(filepopup_win), "glade-xml"); GtkWidget *widget = glade_xml_get_widget(xml, entry); + GdkPixbuf *pixbuf; if (xml == NULL || widget == NULL) return; - gtk_image_set_from_file(GTK_IMAGE(widget), text); + pixbuf = gdk_pixbuf_new_from_file(text, NULL); + + if (pixbuf == NULL) + return; + + if (gdk_pixbuf_get_height(GDK_PIXBUF(pixbuf)) > 150) + { + GdkPixbuf *pixbuf2 = gdk_pixbuf_scale_simple(GDK_PIXBUF(pixbuf), 150, 150, GDK_INTERP_BILINEAR); + g_object_unref(G_OBJECT(pixbuf)); + pixbuf = pixbuf2; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(widget), GDK_PIXBUF(pixbuf)); } static void