Commit e5b891d5 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte
Browse files

GladeGtkWidget: special case GtkScrolledWindow remove parent action

Make sure you can not remove parent if the grand parent is a scrolled window
and the child is not scrollable.

Fix issue #471 "XML not updated after adding element"
parent 3f8275ad
......@@ -705,7 +705,18 @@ widget_parent_changed (GtkWidget *widget,
parent = glade_widget_get_parent (gwidget);
if (parent && !glade_widget_get_internal (parent))
glade_widget_set_action_sensitive (gwidget, "remove_parent", TRUE);
{
GladeWidget *grand_parent;
gboolean can_add = TRUE;
/* We can not use glade_widget_adaptor_add_verify() here because it takes into account placeholders spaces */
if ((grand_parent = glade_widget_get_parent (parent)) &&
GTK_IS_SCROLLED_WINDOW (glade_widget_get_object (grand_parent)) &&
!GTK_IS_SCROLLABLE (widget))
can_add = FALSE;
glade_widget_set_action_sensitive (gwidget, "remove_parent", can_add);
}
else
glade_widget_set_action_sensitive (gwidget, "remove_parent", FALSE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment