GdkPixbuf *pixbuf;
GError *load_error;
gdouble scale;
+ gboolean emblems_applied;
guint ref_count;
};
if (info->emblem_infos == NULL)
return;
+ if (info->emblems_applied)
+ return;
+
w = gdk_pixbuf_get_width (info->pixbuf);
h = gdk_pixbuf_get_height (info->pixbuf);
g_object_unref (info->pixbuf);
info->pixbuf = icon;
}
+
+ info->emblems_applied = TRUE;
}
/* This function contains the complicated logic for deciding
return TRUE;
if (icon_info->pixbuf)
- return TRUE;
+ {
+ apply_emblems (icon_info);
+ return TRUE;
+ }
if (icon_info->load_error)
return FALSE;
return info;
}
+ else if (GDK_IS_PIXBUF (icon))
+ {
+ GdkPixbuf *pixbuf;
+
+ pixbuf = GDK_PIXBUF (icon);
+
+ if ((flags & GTK_ICON_LOOKUP_FORCE_SIZE) != 0)
+ {
+ gint width, height, max;
+ gdouble scale;
+ GdkPixbuf *scaled;
+
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+ max = MAX (width, height);
+ scale = (gdouble) size / (gdouble) max;
+
+ scaled = gdk_pixbuf_scale_simple (pixbuf,
+ 0.5 + width * scale,
+ 0.5 + height * scale,
+ GDK_INTERP_BILINEAR);
+
+ info = gtk_icon_info_new_for_pixbuf (icon_theme, scaled);
+
+ g_object_unref (scaled);
+ }
+ else
+ {
+ info = gtk_icon_info_new_for_pixbuf (icon_theme, pixbuf);
+ }
+
+ return info;
+ }
return NULL;
}