[gtk+/wip/baedert/progressbar: 3/5] listbox: Properly remove placeholders



commit b17bb5273e28fe19672b98844088c561d00975c3
Author: Timm Bäder <mail baedert org>
Date:   Fri Apr 7 19:02:35 2017 +0200

    listbox: Properly remove placeholders

 gtk/gtklistbox.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 31cfc45..9873940 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -2484,6 +2484,13 @@ gtk_list_box_remove (GtkContainer *container,
 
   was_visible = gtk_widget_get_visible (child);
 
+  if (child == priv->placeholder)
+    {
+      gtk_widget_unparent (child);
+      priv->placeholder = NULL;
+      return;
+    }
+
   if (!GTK_IS_LIST_BOX_ROW (child))
     {
       row = g_hash_table_lookup (priv->header_hash, child);
@@ -2565,7 +2572,7 @@ gtk_list_box_forall (GtkContainer *container,
   GSequenceIter *iter;
   GtkListBoxRow *row;
 
-  if (priv->placeholder != NULL && include_internals)
+  if (priv->placeholder != NULL)
     callback (priv->placeholder, callback_target);
 
   iter = g_sequence_get_begin_iter (priv->children);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]