[glade/glade-3-16] Fixed bug when copying a button with custom content. Custom widget was being replaced with a placeho



commit d70c3ce11dd2f03ce6e7518db78d2aa93d5876ef
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Mon Sep 16 15:40:55 2013 -0300

    Fixed bug when copying a button with custom content.
    Custom widget was being replaced with a placeholder when syncing
    custom-child property.

 plugins/gtk+/glade-gtk-button.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-button.c b/plugins/gtk+/glade-gtk-button.c
index 3c588df..ab6f985 100644
--- a/plugins/gtk+/glade-gtk-button.c
+++ b/plugins/gtk+/glade-gtk-button.c
@@ -186,8 +186,13 @@ glade_gtk_button_set_property (GladeWidgetAdaptor * adaptor,
   if (strcmp (id, "custom-child") == 0)
     {
       GtkWidget *child = gtk_bin_get_child (GTK_BIN (object));
+      gboolean custom_child = g_value_get_boolean (value);
 
-      if (g_value_get_boolean (value))
+      /* Avoid removing a child if we already have a custom child */
+      if (custom_child && (child && glade_widget_get_from_gobject (child)))
+        return;
+
+      if (custom_child)
         {
           if (child)
             gtk_container_remove (GTK_CONTAINER (object), child);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]