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.
parent 1760e74e
......@@ -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;
}
......@@ -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_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment