[gnome-initial-setup] Fix a corner-case in language filtering



commit 4d65eae960d6973a47b36a7c1669c90941342839
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 27 17:58:48 2013 -0500

    Fix a corner-case in language filtering
    
    If we already show the 'no matches' label, and the user adds
    more to the match string, we would inadvertedly hide the
    'no matches' label. Fix that by ignoring the label when checking
    if the list is empty.

 .../pages/language/gis-language-page.c             |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c b/gnome-initial-setup/pages/language/gis-language-page.c
index 0bf3eac..531052f 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -299,6 +299,7 @@ child_activated (EggListBox      *box,
 
 typedef struct {
   gint count;
+  GtkWidget *ignore;
 } CountChildrenData;
 
 static void
@@ -306,7 +307,9 @@ count_visible_children (GtkWidget *widget,
                         gpointer   user_data)
 {
   CountChildrenData *data = user_data;
-  if (gtk_widget_get_child_visible (widget) && gtk_widget_get_visible (widget))
+  if (widget != data->ignore &&
+      gtk_widget_get_child_visible (widget) &&
+      gtk_widget_get_visible (widget))
     data->count++;
 }
 
@@ -319,6 +322,8 @@ end_refilter (EggListBox *list_box,
 
   CountChildrenData data = { 0 };
 
+  data.ignore = priv->no_results;
+
   gtk_container_foreach (GTK_CONTAINER (list_box),
                          count_visible_children, &data);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]