Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon

2008-06-16  Carlos Garnacho  <carlos@imendio.com>

        Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon
        anymore

        * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property):
        Allow again setting any of the properties to render an image back to
        NULL.

svn path=/trunk/; revision=20395
This commit is contained in:
Carlos Garnacho 2008-06-16 10:03:16 +00:00 committed by Carlos Garnacho
parent 0fc1f3aeed
commit 6afb455e5a
2 changed files with 17 additions and 20 deletions

View File

@ -1,3 +1,12 @@
2008-06-16 Carlos Garnacho <carlos@imendio.com>
Bug 538519 GtkCellRendererPixbuf doesn't allow unsetting the icon
anymore
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property):
Allow again setting any of the properties to render an image back to
NULL.
2008-06-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimage.c: When pixel-size is specified, use

View File

@ -332,11 +332,8 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
switch (param_id)
{
case PROP_PIXBUF:
if (g_value_get_object (value))
{
unset_image_properties (cellpixbuf);
cellpixbuf->pixbuf = (GdkPixbuf *) g_value_dup_object (value);
}
unset_image_properties (cellpixbuf);
cellpixbuf->pixbuf = (GdkPixbuf *) g_value_dup_object (value);
break;
case PROP_PIXBUF_EXPANDER_OPEN:
if (cellpixbuf->pixbuf_expander_open)
@ -349,11 +346,8 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
cellpixbuf->pixbuf_expander_closed = (GdkPixbuf*) g_value_dup_object (value);
break;
case PROP_STOCK_ID:
if (g_value_get_string (value))
{
unset_image_properties (cellpixbuf);
priv->stock_id = g_value_dup_string (value);
}
unset_image_properties (cellpixbuf);
priv->stock_id = g_value_dup_string (value);
break;
case PROP_STOCK_SIZE:
priv->stock_size = g_value_get_uint (value);
@ -363,21 +357,15 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object,
priv->stock_detail = g_value_dup_string (value);
break;
case PROP_ICON_NAME:
if (g_value_get_string (value))
{
unset_image_properties (cellpixbuf);
priv->icon_name = g_value_dup_string (value);
}
unset_image_properties (cellpixbuf);
priv->icon_name = g_value_dup_string (value);
break;
case PROP_FOLLOW_STATE:
priv->follow_state = g_value_get_boolean (value);
break;
case PROP_GICON:
if (g_value_get_object (value))
{
unset_image_properties (cellpixbuf);
priv->gicon = (GIcon *) g_value_dup_object (value);
}
unset_image_properties (cellpixbuf);
priv->gicon = (GIcon *) g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);