[epiphany] passwords-dialog: Hide filtered out rows when searching
- From: Michael Catanzaro <mcatanzaro src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [epiphany] passwords-dialog: Hide filtered out rows when searching
 
- Date: Fri,  5 Jun 2020 19:57:51 +0000 (UTC)
 
commit 7735f7b54486c11bf6c208f01cec3f844d5fa0e2
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]