[gtk+/wip/csoriano/pathbar-bin-view-window: 25/35] gtkhidingbox: add getter for overflow children



commit a2105873bb46bfbd1c8272e9797272e0081e3026
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 a1ef02c..e0b46aa 100644
--- a/gtk/gtkhidingbox.c
+++ b/gtk/gtkhidingbox.c
@@ -524,3 +524,21 @@ gtk_hiding_box_get_inverted (GtkHidingBox *box)
 
   return priv->inverted;
 }
+
+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 447ac4b..b44dc55 100644
--- a/gtk/gtkhidingboxprivate.h
+++ b/gtk/gtkhidingboxprivate.h
@@ -70,6 +70,8 @@ void              gtk_hiding_box_set_inverted            (GtkHidingBox      *box
 GDK_AVAILABLE_IN_3_20
 gboolean          gtk_hiding_box_get_inverted            (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]