combobox: Handle NULLing the cellview on remove simpler

This commit is contained in:
Benjamin Otte 2015-07-29 22:25:52 +02:00
parent 1261ec985b
commit bbd9c59832

View File

@ -1556,18 +1556,12 @@ gtk_combo_box_add (GtkContainer *container,
gtk_widget_unparent (priv->cell_view);
_gtk_bin_set_child (GTK_BIN (container), NULL);
gtk_widget_queue_resize (GTK_WIDGET (container));
priv->cell_view = NULL;
}
gtk_widget_set_parent (widget, GTK_WIDGET (container));
_gtk_bin_set_child (GTK_BIN (container), widget);
if (priv->cell_view &&
widget != priv->cell_view)
{
/* since the cell_view was unparented, it's gone now */
priv->cell_view = NULL;
}
if (priv->has_entry)
{
/* this flag is a hack to tell the entry to fill its allocation.