Commit 6a276d59 authored by Cosimo Cecchi's avatar Cosimo Cecchi

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.
parent b118093f
...@@ -6852,7 +6852,7 @@ static NautilusIconInfo * ...@@ -6852,7 +6852,7 @@ static NautilusIconInfo *
nautilus_icon_container_get_icon_images (NautilusIconContainer *container, nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
NautilusIconData *data, NautilusIconData *data,
int size, int size,
GList **emblem_pixbufs, GList **emblem_icons,
char **embedded_text, char **embedded_text,
gboolean for_drag_accept, gboolean for_drag_accept,
gboolean need_large_embeddded_text, gboolean need_large_embeddded_text,
...@@ -6864,7 +6864,7 @@ nautilus_icon_container_get_icon_images (NautilusIconContainer *container, ...@@ -6864,7 +6864,7 @@ nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container); klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
g_assert (klass->get_icon_images != NULL); 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 static void
...@@ -7023,7 +7023,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, ...@@ -7023,7 +7023,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
int n_attach_points; int n_attach_points;
gboolean has_embedded_text_rect; gboolean has_embedded_text_rect;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GList *emblem_pixbufs, *l; GList *emblem_icons, *l;
char *editable_text, *additional_text; char *editable_text, *additional_text;
char *embedded_text; char *embedded_text;
GdkRectangle embedded_text_rect; GdkRectangle embedded_text_rect;
...@@ -7055,11 +7055,11 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, ...@@ -7055,11 +7055,11 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
icon_size = MIN (icon_size, max_image_size); icon_size = MIN (icon_size, max_image_size);
/* Get the icons. */ /* Get the icons. */
emblem_pixbufs = NULL; emblem_icons = NULL;
embedded_text = NULL; embedded_text = NULL;
large_embedded_text = icon_size > ICON_SIZE_FOR_LARGE_EMBEDDED_TEXT; large_embedded_text = icon_size > ICON_SIZE_FOR_LARGE_EMBEDDED_TEXT;
icon_info = nautilus_icon_container_get_icon_images (container, icon->data, icon_size, icon_info = nautilus_icon_container_get_icon_images (container, icon->data, icon_size,
&emblem_pixbufs, &emblem_icons,
&embedded_text, &embedded_text,
icon == details->drop_target, icon == details->drop_target,
large_embedded_text, &embedded_text_needs_loading, large_embedded_text, &embedded_text_needs_loading,
...@@ -7076,8 +7076,8 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, ...@@ -7076,8 +7076,8 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
&embedded_text_rect); &embedded_text_rect);
/* apply emblems */ /* apply emblems */
if (emblem_pixbufs != NULL) { if (emblem_icons != NULL) {
l = emblem_pixbufs; l = emblem_icons;
emblem = g_emblem_new (l->data); emblem = g_emblem_new (l->data);
emblemed_icon = g_emblemed_icon_new (G_ICON (pixbuf), emblem); emblemed_icon = g_emblemed_icon_new (G_ICON (pixbuf), emblem);
...@@ -7136,7 +7136,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container, ...@@ -7136,7 +7136,7 @@ nautilus_icon_container_update_icon (NautilusIconContainer *container,
/* Let the pixbufs go. */ /* Let the pixbufs go. */
g_object_unref (pixbuf); 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 (editable_text);
g_free (additional_text); g_free (additional_text);
......
...@@ -141,7 +141,7 @@ typedef struct { ...@@ -141,7 +141,7 @@ typedef struct {
NautilusIconInfo *(* get_icon_images) (NautilusIconContainer *container, NautilusIconInfo *(* get_icon_images) (NautilusIconContainer *container,
NautilusIconData *data, NautilusIconData *data,
int icon_size, int icon_size,
GList **emblem_pixbufs, GList **emblem_icons,
char **embedded_text, char **embedded_text,
gboolean for_drag_accept, gboolean for_drag_accept,
gboolean need_large_embeddded_text, gboolean need_large_embeddded_text,
......
...@@ -52,7 +52,7 @@ static NautilusIconInfo * ...@@ -52,7 +52,7 @@ static NautilusIconInfo *
fm_icon_container_get_icon_images (NautilusIconContainer *container, fm_icon_container_get_icon_images (NautilusIconContainer *container,
NautilusIconData *data, NautilusIconData *data,
int size, int size,
GList **emblem_pixbufs, GList **emblem_icons,
char **embedded_text, char **embedded_text,
gboolean for_drag_accept, gboolean for_drag_accept,
gboolean need_large_embeddded_text, gboolean need_large_embeddded_text,
...@@ -64,7 +64,6 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container, ...@@ -64,7 +64,6 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
NautilusFile *file; NautilusFile *file;
gboolean use_embedding; gboolean use_embedding;
NautilusFileIconFlags flags; NautilusFileIconFlags flags;
guint emblem_size;
file = (NautilusFile *) data; file = (NautilusFile *) data;
...@@ -78,20 +77,12 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container, ...@@ -78,20 +77,12 @@ fm_icon_container_get_icon_images (NautilusIconContainer *container,
use_embedding = *embedded_text != NULL; use_embedding = *embedded_text != NULL;
} }
if (emblem_pixbufs != NULL) { if (emblem_icons != NULL) {
emblem_size = nautilus_icon_get_emblem_size_for_icon_size (size); emblems_to_ignore = fm_directory_view_get_emblem_names_to_exclude
/* don't return images larger than the actual icon size */ (FM_DIRECTORY_VIEW (icon_view));
emblem_size = MIN (emblem_size, size); *emblem_icons = nautilus_file_get_emblem_icons (file,
emblems_to_ignore);
if (emblem_size > 0) { g_strfreev (emblems_to_ignore);
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);
}
} }
*has_window_open = nautilus_file_has_open_window (file); *has_window_open = nautilus_file_has_open_window (file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment