diff options
-rw-r--r-- | widgets/misc/ChangeLog | 12 | ||||
-rw-r--r-- | widgets/misc/e-combo-button.c | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 7d070b68bb..e7dd1bffe4 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,15 @@ +2002-02-21 Ettore Perazzoli <ettore@ximian.com> + + * e-combo-button.c (set_icon): gtk_widget_show() the icon_pixmap + if the specified icon is not NULL. + +2002-02-20 Ettore Perazzoli <ettore@ximian.com> + + * e-combo-button.c (set_icon): Work with a NULL @pixbuf as well + [in that case, just hide the current icon widget]. + (e_combo_button_set_icon): Remove the precondition about @pixbuf + being non-NULL. + 2002-02-08 JP Rosevear <jpr@ximian.com> * e-url-button.[hc]: remove briefly used files diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index c037586fc6..e6634b5c86 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -133,11 +133,22 @@ set_icon (EComboButton *combo_button, priv = combo_button->priv; + if (priv->icon != NULL) + gdk_pixbuf_unref (priv->icon); + + if (pixbuf == NULL) { + priv->icon = NULL; + gtk_widget_hide (priv->icon_pixmap); + return; + } + priv->icon = gdk_pixbuf_ref (pixbuf); gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128); gtk_pixmap_set (GTK_PIXMAP (priv->icon_pixmap), pixmap, mask); + gtk_widget_show (priv->icon_pixmap); + gdk_pixmap_unref (pixmap); gdk_pixmap_unref (mask); } @@ -407,7 +418,6 @@ e_combo_button_set_icon (EComboButton *combo_button, { g_return_if_fail (combo_button != NULL); g_return_if_fail (E_IS_COMBO_BUTTON (combo_button)); - g_return_if_fail (pixbuf != NULL); set_icon (combo_button, pixbuf); } |