diff options
author | Timm Bäder <mail@baedert.org> | 2018-02-04 17:51:18 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-02-04 17:51:18 +0100 |
commit | fd148d1ef52735192171eb303fba9c9fb5d9ae07 (patch) | |
tree | 407b74bbbd8044401985db87119fdb1c16c68aeb | |
parent | baa3df51ad29901f524516239ad7e8b674d3dd4c (diff) | |
download | gtk+-fd148d1ef52735192171eb303fba9c9fb5d9ae07.tar.gz |
searchbar: Properly remove child widgets
Since the GtkSearchBar is not the direct parent, we need to remove them
properly from priv->box_center.
-rw-r--r-- | gtk/gtksearchbar.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c index 316abc33ec..acd85995c9 100644 --- a/gtk/gtksearchbar.c +++ b/gtk/gtksearchbar.c @@ -321,6 +321,23 @@ gtk_search_bar_add (GtkContainer *container, } static void +gtk_search_bar_remove (GtkContainer *container, + GtkWidget *child) +{ + GtkSearchBar *bar = GTK_SEARCH_BAR (container); + GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar); + + if (priv->box_center == NULL) + { + GTK_CONTAINER_CLASS (gtk_search_bar_parent_class)->remove (container, child); + } + else + { + gtk_container_remove (GTK_CONTAINER (priv->box_center), child); + } +} + +static void gtk_search_bar_set_property (GObject *object, guint prop_id, const GValue *value, @@ -390,6 +407,7 @@ gtk_search_bar_class_init (GtkSearchBarClass *klass) object_class->get_property = gtk_search_bar_get_property; container_class->add = gtk_search_bar_add; + container_class->remove = gtk_search_bar_remove; /** * GtkSearchBar:search-mode-enabled: |