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 *
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);
......
......@@ -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,
......
......@@ -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,21 +77,13 @@ 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) {
if (emblem_icons != NULL) {
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,
*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);
......
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