mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
GtkBox: Ensure we only allow one center child
Glade was happily adding multiple center widgets. Oops.
This commit is contained in:
parent
0939857e70
commit
b4a288a592
@ -2619,10 +2619,14 @@ gtk_box_set_center_widget (GtkBox *box,
|
||||
|
||||
g_return_if_fail (GTK_IS_BOX (box));
|
||||
|
||||
if (priv->center)
|
||||
{
|
||||
gtk_box_remove (GTK_CONTAINER (box), priv->center->widget);
|
||||
priv->center = NULL;
|
||||
}
|
||||
|
||||
if (widget)
|
||||
priv->center = gtk_box_pack (box, widget, FALSE, TRUE, 0, GTK_PACK_START);
|
||||
else if (priv->center)
|
||||
gtk_box_remove (GTK_CONTAINER (box), priv->center->widget);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user