[nautilus] icon-container: don't care about the emblem size



commit 6a276d59af54413c59188ffb0143ffa6e1fe94a1
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Nov 9 16:58:22 2010 +0100

    icon-container: don't care about the emblem size
    
    Use only GIcons for emblems, not pixbufs. We used to rely on pixbufs to
    get emblems at a specific size, but that's not important anymore now
    that GTK+ takes care of it internally.

 libnautilus-private/nautilus-icon-container.c |   16 ++++++++--------
 libnautilus-private/nautilus-icon-container.h |    2 +-
 src/file-manager/fm-icon-container.c          |   23 +++++++----------------
 3 files changed, 16 insertions(+), 25 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 35f7e90..bed13a0 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -6852,7 +6852,7 @@ static NautilusIconInfo *
 nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
 					 NautilusIconData      *data,
 					 int                    size,
-					 GList                **emblem_pixbufs,
+					 GList                **emblem_icons,
 					 char                 **embedded_text,
 					 gboolean               for_drag_accept,
 					 gboolean               need_large_embeddded_text,
@@ -6864,7 +6864,7 @@ nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
 	klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
 	g_assert (klass->get_icon_images != NULL);
 
-	return klass->get_icon_images (container, data, size, emblem_pixbufs, embedded_text, for_drag_accept, need_large_embeddded_text, embedded_text_needs_loading, has_open_window);
+	return klass->get_icon_images (container, data, size, emblem_icons, embedded_text, for_drag_accept, need_large_embeddded_text, embedded_text_needs_loading, has_open_window);
 }
 
 static void
@@ -7023,7 +7023,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
 	int n_attach_points;
 	gboolean has_embedded_text_rect;
 	GdkPixbuf *pixbuf;
-	GList *emblem_pixbufs, *l;
+	GList *emblem_icons, *l;
 	char *editable_text, *additional_text;
 	char *embedded_text;
 	GdkRectangle embedded_text_rect;
@@ -7055,11 +7055,11 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
 	icon_size = MIN (icon_size, max_image_size);
 
 	/* Get the icons. */
-	emblem_pixbufs = NULL;
+	emblem_icons = NULL;
 	embedded_text = NULL;
 	large_embedded_text = icon_size > ICON_SIZE_FOR_LARGE_EMBEDDED_TEXT;
 	icon_info = nautilus_icon_container_get_icon_images (container, icon->data, icon_size,
-							     &emblem_pixbufs,
+							     &emblem_icons,
 							     &embedded_text,
 							     icon == details->drop_target,							     
 							     large_embedded_text, &embedded_text_needs_loading,
@@ -7076,8 +7076,8 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
 								       &embedded_text_rect);
 
 	/* apply emblems */
-	if (emblem_pixbufs != NULL) {
-		l = emblem_pixbufs;
+	if (emblem_icons != NULL) {
+		l = emblem_icons;
 
 		emblem = g_emblem_new (l->data);
 		emblemed_icon = g_emblemed_icon_new (G_ICON (pixbuf), emblem);
@@ -7136,7 +7136,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
 
 	/* Let the pixbufs go. */
 	g_object_unref (pixbuf);
-	g_list_free_full (emblem_pixbufs, g_object_unref);
+	g_list_free_full (emblem_icons, g_object_unref);
 
 	g_free (editable_text);
 	g_free (additional_text);
diff --git a/libnautilus-private/nautilus-icon-container.h b/libnautilus-private/nautilus-icon-container.h
index bb79559..e8a066a 100644
--- a/libnautilus-private/nautilus-icon-container.h
+++ b/libnautilus-private/nautilus-icon-container.h
@@ -141,7 +141,7 @@ typedef struct {
 	NautilusIconInfo *(* get_icon_images)     (NautilusIconContainer *container,
 						   NautilusIconData *data,
 						   int icon_size,
-						   GList **emblem_pixbufs,
+						   GList **emblem_icons,
 						   char **embedded_text,
 						   gboolean for_drag_accept,
 						   gboolean need_large_embeddded_text,
diff --git a/src/file-manager/fm-icon-container.c b/src/file-manager/fm-icon-container.c
index 546cb56..02e3249 100644
--- a/src/file-manager/fm-icon-container.c
+++ b/src/file-manager/fm-icon-container.c
@@ -52,7 +52,7 @@ static NautilusIconInfo *
 fm_icon_container_get_icon_images (NautilusIconContainer *container,
 				   NautilusIconData      *data,
 				   int                    size,
-				   GList                **emblem_pixbufs,
+				   GList                **emblem_icons,
 				   char                 **embedded_text,
 				   gboolean               for_drag_accept,
 				   gboolean               need_large_embeddded_text,
@@ -64,7 +64,6 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
 	NautilusFile *file;
 	gboolean use_embedding;
 	NautilusFileIconFlags flags;
-	guint emblem_size;
 
 	file = (NautilusFile *) data;
 
@@ -78,20 +77,12 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
 		use_embedding = *embedded_text != NULL;
 	}
 	
-	if (emblem_pixbufs != NULL) {
-		emblem_size = nautilus_icon_get_emblem_size_for_icon_size (size);
-		/* don't return images larger than the actual icon size */
-		emblem_size = MIN (emblem_size, size);
-
-		if (emblem_size > 0) {
-			emblems_to_ignore = fm_directory_view_get_emblem_names_to_exclude 
-				(FM_DIRECTORY_VIEW (icon_view));
-			*emblem_pixbufs = nautilus_file_get_emblem_pixbufs (file,
-									    emblem_size,
-									    FALSE,
-									    emblems_to_ignore);
-			g_strfreev (emblems_to_ignore);
-		}
+	if (emblem_icons != NULL) {
+		emblems_to_ignore = fm_directory_view_get_emblem_names_to_exclude 
+			(FM_DIRECTORY_VIEW (icon_view));
+		*emblem_icons = nautilus_file_get_emblem_icons (file,
+								emblems_to_ignore);
+		g_strfreev (emblems_to_ignore);
 	}
 
 	*has_window_open = nautilus_file_has_open_window (file);



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