From a58ca2f686a0f97f45cf82634645820fd09bcb05 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Fri, 6 Nov 2015 19:36:04 +0100 Subject: [PATCH] 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(+) diff --git a/gtk/gtkhidingbox.c b/gtk/gtkhidingbox.c index a1ef02cedb..e0b46aafb7 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 447ac4b13e..b44dc55701 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_ */ -- GitLab