]> Pileus Git - ~andy/gtk/commitdiff
Bug 555270 – Allow unsetting a MessageDialog's image
authorChristian Dywan <christian@imendio.com>
Wed, 8 Oct 2008 02:27:07 +0000 (02:27 +0000)
committerChristian Dywan <cdywan@src.gnome.org>
Wed, 8 Oct 2008 02:27:07 +0000 (02:27 +0000)
2008-10-08  Christian Dywan  <christian@imendio.com>

Bug 555270 – Allow unsetting a MessageDialog's image

* gtk/gtkmessagedialog.c (gtk_message_dialog_set_property),
Remove a superfluous cast to GtkWidget*
(gtk_message_dialog_set_image): Accept NULL for the image
and unset the image in that case.

svn path=/trunk/; revision=21607

ChangeLog
gtk/gtkmessagedialog.c

index 1cf64d5a890d1330414af2ce714fae57b29404ca..61dac2f26a2c087242f7ca8dbefc16ab4d6efda8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-08  Christian Dywan  <christian@imendio.com>
+
+       Bug 555270 – Allow unsetting a MessageDialog's image
+
+       * gtk/gtkmessagedialog.c (gtk_message_dialog_set_property),
+        Remove a superfluous cast to GtkWidget*
+       (gtk_message_dialog_set_image): Accept NULL for the image
+       and unset the image in that case.
+
 2008-10-08  Christian Dywan  <christian@imendio.com>
 
        Bug 436533 – Allow more space efficient scroll arrows placement
index ca8356018bd20608bf68404b21bc3f109fa64044..ecae119220722cb5f400d821c4a9672a58b47fb1 100644 (file)
@@ -418,7 +418,7 @@ gtk_message_dialog_set_property (GObject      *object,
                                g_value_get_boolean (value));
       break;
     case PROP_IMAGE:
-      gtk_message_dialog_set_image (dialog, (GtkWidget *)g_value_get_object (value));
+      gtk_message_dialog_set_image (dialog, g_value_get_object (value));
       break;
 
     default:
@@ -628,6 +628,13 @@ gtk_message_dialog_set_image (GtkMessageDialog *dialog,
   GtkWidget *parent;
 
   g_return_if_fail (GTK_IS_MESSAGE_DIALOG (dialog));
+  g_return_if_fail (image == NULL || GTK_IS_WIDGET (image));
+
+  if (image == NULL)
+    {
+      image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG);
+      gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+    }
 
   priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);