diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-09-30 21:57:41 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-10-06 23:31:18 -0400 |
commit | b937557d95ef44c1b0a96c100ec07894b94a705f (patch) | |
tree | e5ae6ec5d81f86910fc1f282f5ee3cd2a61af97b /gtk/gtkflowbox.c | |
parent | f733903334bd90cab36d4620fb1541fc76361017 (diff) | |
download | gtk+-b937557d95ef44c1b0a96c100ec07894b94a705f.tar.gz |
Make resetting a filter work properly
We need to make sure all children are marked as child-visible
again when the filter func is reset.
Diffstat (limited to 'gtk/gtkflowbox.c')
-rw-r--r-- | gtk/gtkflowbox.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 9f38760800..a0f1f7e9dd 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -927,6 +927,23 @@ gtk_flow_box_apply_filter (GtkFlowBox *box, } static void +gtk_flow_box_apply_filter_all (GtkFlowBox *box) +{ + GSequenceIter *iter; + + for (iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children); + !g_sequence_iter_is_end (iter); + iter = g_sequence_iter_next (iter)) + { + GtkFlowBoxChild *child; + + child = g_sequence_get (iter); + gtk_flow_box_apply_filter (box, child); + } + gtk_widget_queue_resize (GTK_WIDGET (box)); +} + +static void gtk_flow_box_apply_sort (GtkFlowBox *box, GtkFlowBoxChild *child) { @@ -4582,7 +4599,7 @@ gtk_flow_box_set_filter_func (GtkFlowBox *box, priv->filter_data = user_data; priv->filter_destroy = destroy; - gtk_flow_box_invalidate_filter (box); + gtk_flow_box_apply_filter_all (box); } /** @@ -4605,20 +4622,7 @@ gtk_flow_box_invalidate_filter (GtkFlowBox *box) g_return_if_fail (GTK_IS_FLOW_BOX (box)); if (BOX_PRIV (box)->filter_func != NULL) - { - GSequenceIter *iter; - - for (iter = g_sequence_get_begin_iter (BOX_PRIV (box)->children); - !g_sequence_iter_is_end (iter); - iter = g_sequence_iter_next (iter)) - { - GtkFlowBoxChild *child; - - child = g_sequence_get (iter); - gtk_flow_box_apply_filter (box, child); - } - gtk_widget_queue_resize (GTK_WIDGET (box)); - } + gtk_flow_box_apply_filter_all (box); } /* Sorting {{{2 */ |