summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2013-09-16 15:40:55 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2013-09-16 16:02:56 -0300
commitf5308942e755afa144057156fa022031f32681e2 (patch)
tree55b0b97d2f445a1046619f34e838867178f02b55
parent44362e08e5e449e9e6e3598fa2b94debc0d430ad (diff)
downloadglade-f5308942e755afa144057156fa022031f32681e2.tar.gz
Fixed bug when copying a button with custom content.
Custom widget was being replaced with a placeholder when syncing custom-child property.
-rw-r--r--plugins/gtk+/glade-gtk-button.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/gtk+/glade-gtk-button.c b/plugins/gtk+/glade-gtk-button.c
index 3c588df1..ab6f9859 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);