[epiphany/wip/exalm/libhandy-take-2: 18/19] passwords-dialog: Hide filtered out rows when searching



commit 2282c540080ad1afe81c5d9696e9b32df9bc6ef4
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat May 30 15:59:25 2020 +0500

    passwords-dialog: Hide filtered out rows when searching
    
    Due to how GTK CSS works, children with
    gtk_widget_set_child_visible(child, FALSE) still count as visible and cause
    glitches with :first-child and :last-child. To work around that, set
    visible property as well.

 src/preferences/passwords-dialog.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences/passwords-dialog.c b/src/preferences/passwords-dialog.c
index aa6349263..b07ed095a 100644
--- a/src/preferences/passwords-dialog.c
+++ b/src/preferences/passwords-dialog.c
@@ -426,8 +426,11 @@ password_filter (GtkListBoxRow *row,
   gboolean visible = FALSE;
   const char *search_text = ephy_data_dialog_get_search_text (EPHY_DATA_DIALOG (dialog));
 
-  if (search_text == NULL)
+  if (search_text == NULL) {
+    gtk_widget_show (GTK_WIDGET (row));
+
     return TRUE;
+  }
 
   origin = ephy_password_record_get_origin (record);
   username = ephy_password_record_get_username (record);
@@ -437,6 +440,8 @@ password_filter (GtkListBoxRow *row,
   else if (username != NULL && g_strrstr (username, search_text) != NULL)
     visible = TRUE;
 
+  gtk_widget_set_visible (GTK_WIDGET (row), visible);
+
   return visible;
 }
 


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