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.
This commit is contained in:
Carlos Soriano
2015-11-06 19:36:04 +01:00
parent 21f0fddfc9
commit c68cea3292
2 changed files with 20 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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_ */