Commit 3b94aec9 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

GtkBox, GtkGrid: support adding widgets even if there is no placeholder

To make things easier you can always add a widget to a box or grid even if
there is no more placeholders.
Adding a widget will automatically increase the box size number or
the grid column count.

Fix issue #470 "Widgets of type need placeholders to add children"
parent 558a92d6
......@@ -151,7 +151,7 @@ glade_gtk_grid_refresh_placeholders (GtkGrid *grid,
}
static void
glade_gtk_grid_parse_finished (GladeProject *project, GObject *container)
glade_gtk_grid_refresh_size (GObject *container)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (container);
gint initial_rows = 0, initial_columns = 0;
......@@ -193,6 +193,12 @@ glade_gtk_grid_parse_finished (GladeProject *project, GObject *container)
glade_gtk_grid_refresh_placeholders (GTK_GRID (container), TRUE);
}
static void
glade_gtk_grid_parse_finished (GladeProject *project, GObject *container)
{
glade_gtk_grid_refresh_size (container);
}
void
glade_gtk_grid_post_create (GladeWidgetAdaptor *adaptor,
GObject *container,
......@@ -289,7 +295,7 @@ glade_gtk_grid_add_child (GladeWidgetAdaptor *adaptor,
gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
glade_gtk_grid_refresh_placeholders (GTK_GRID (object), FALSE);
glade_gtk_grid_refresh_size (object);
}
void
......
......@@ -617,6 +617,7 @@
<get-property-function>glade_gtk_box_get_property</get-property-function>
<verify-function>glade_gtk_box_verify_property</verify-function>
<add-child-function>glade_gtk_box_add_child</add-child-function>
<add-child-verify-function>gtk_true</add-child-verify-function>
<remove-child-function>glade_gtk_box_remove_child</remove-child-function>
<replace-child-function>glade_gtk_box_replace_child</replace-child-function>
<child-set-property-function>glade_gtk_box_set_child_property</child-set-property-function>
......@@ -2240,6 +2241,7 @@
<child-verify-function>glade_gtk_grid_child_verify_property</child-verify-function>
<get-children-function>glade_gtk_grid_get_children</get-children-function>
<add-child-function>glade_gtk_grid_add_child</add-child-function>
<add-child-verify-function>gtk_true</add-child-verify-function>
<remove-child-function>glade_gtk_grid_remove_child</remove-child-function>
<replace-child-function>glade_gtk_grid_replace_child</replace-child-function>
<set-property-function>glade_gtk_grid_set_property</set-property-function>
......
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