[gtk+/wip/csoriano/pathbar-prototype: 39/42] gtkhidingbox: add getter for overflow children



commit 78a0b88cce638f4ea936131be0a174ddc62b7db8
Author: Carlos Soriano <csoriano gnome org>
Date:   Fri Nov 6 19:36:04 2015 +0100

    gtkhidingbox: add getter for overflow children
    
    Useful to know which children cannot be shown, so clients
    can manage themselves those.
    A use case is GtkPathBar for the popup overflow menu.

 gtk/gtkhidingbox.c        |   18 ++++++++++++++++++
 gtk/gtkhidingboxprivate.h |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkhidingbox.c b/gtk/gtkhidingbox.c
index 868b49e..2267a95 100644
--- a/gtk/gtkhidingbox.c
+++ b/gtk/gtkhidingbox.c
@@ -525,3 +525,21 @@ gtk_hiding_box_get_hide_direction (GtkHidingBox *box)
 
   return priv->hide_direction;
 }
+
+GList *
+gtk_hiding_box_get_overflow_children (GtkHidingBox *box)
+{
+  GtkHidingBoxPrivate *priv ;
+  GList *result = NULL;
+  GList *l;
+
+  g_return_val_if_fail (GTK_IS_HIDING_BOX (box), 0);
+
+  priv = gtk_hiding_box_get_instance_private (box);
+
+  for (l = priv->children; l != NULL; l = l->next)
+    if (gtk_widget_is_visible (l->data) && !gtk_widget_get_child_visible (l->data))
+      result = g_list_append (result, l->data);
+
+  return result;
+}
diff --git a/gtk/gtkhidingboxprivate.h b/gtk/gtkhidingboxprivate.h
index b894237..adcc248 100644
--- a/gtk/gtkhidingboxprivate.h
+++ b/gtk/gtkhidingboxprivate.h
@@ -70,6 +70,8 @@ void              gtk_hiding_box_set_hide_direction      (GtkHidingBox      *box
 GDK_AVAILABLE_IN_3_20
 GtkDirectionType  gtk_hiding_box_get_hide_direction      (GtkHidingBox      *box);
 
+GDK_AVAILABLE_IN_3_20
+GList             *gtk_hiding_box_get_overflow_children  (GtkHidingBox      *box);
 G_END_DECLS
 
 #endif /* GTK_HIDING_BOX_PRIVATE_H_ */


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