[nautilus] file: fix missing frame image around some previews



commit 0b54210fa927efc0b5dabd3f83c03c1f8a28a61c
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Oct 29 19:59:45 2012 -0400

    file: fix missing frame image around some previews
    
    This fixes a regression introduced in commit
    17f17214a64674bd3079d1a252fed2b6103f9ff4

 libnautilus-private/nautilus-file.c         |    6 +++++-
 libnautilus-private/nautilus-ui-utilities.c |    9 ---------
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index bfa3bc3..13482e1 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -4284,7 +4284,11 @@ nautilus_file_get_icon (NautilusFile *file,
 								 MAX (h * scale, 1),
 								 GDK_INTERP_BILINEAR);
 
-			nautilus_ui_frame_image (&scaled_pixbuf);
+			/* We don't want frames around small icons */
+			if (!gdk_pixbuf_get_has_alpha (raw_pixbuf) || s >= 128) {
+				nautilus_ui_frame_image (&scaled_pixbuf);
+			}
+
 			g_object_unref (raw_pixbuf);
 
 			/* Don't scale up if more than 25%, then read the original
diff --git a/libnautilus-private/nautilus-ui-utilities.c b/libnautilus-private/nautilus-ui-utilities.c
index 539ddca..0a1e374 100644
--- a/libnautilus-private/nautilus-ui-utilities.c
+++ b/libnautilus-private/nautilus-ui-utilities.c
@@ -194,21 +194,12 @@ nautilus_ui_frame_image (GdkPixbuf **pixbuf)
 {
 	GdkPixbuf *pixbuf_with_frame, *frame;
 	int left_offset, top_offset, right_offset, bottom_offset;
-	int size;
 
 	frame = nautilus_get_thumbnail_frame ();
 	if (frame == NULL) {
 		return;
 	}
 
-	size = MAX (gdk_pixbuf_get_width (*pixbuf),
-		    gdk_pixbuf_get_height (*pixbuf));
-
-	/* We don't want frames around small icons */
-	if (size < 128 && gdk_pixbuf_get_has_alpha (*pixbuf)) {
-		return;
-	}
-
 	left_offset = NAUTILUS_THUMBNAIL_FRAME_LEFT;
 	top_offset = NAUTILUS_THUMBNAIL_FRAME_TOP;
 	right_offset = NAUTILUS_THUMBNAIL_FRAME_RIGHT;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]