From 724c7deeff753b547e3faa4e07b04845a11a330b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 15 Nov 2023 14:17:30 +0100 Subject: [PATCH] members-page: Make sure search entry is focused after it is revealed --- .../room_details/members_page/members_list_view/mod.rs | 6 ++++++ .../room_details/members_page/members_list_view/mod.ui | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/session/view/content/room_details/members_page/members_list_view/mod.rs b/src/session/view/content/room_details/members_page/members_list_view/mod.rs index 661fd969..e5691281 100644 --- a/src/session/view/content/room_details/members_page/members_list_view/mod.rs +++ b/src/session/view/content/room_details/members_page/members_list_view/mod.rs @@ -30,6 +30,8 @@ mod imp { resource = "/org/gnome/Fractal/ui/session/view/content/room_details/members_page/members_list_view/mod.ui" )] pub struct MembersListView { + #[template_child] + pub search_bar: TemplateChild, #[template_child] pub search_entry: TemplateChild, #[template_child] @@ -89,6 +91,10 @@ mod imp { fn constructed(&self) { self.parent_constructed(); + // Needed because the GtkSearchEntry is not the direct child of the + // GtkSearchBear. + self.search_bar.connect_entry(&*self.search_entry); + fn search_string(member: Member) -> String { format!( "{} {} {} {}", diff --git a/src/session/view/content/room_details/members_page/members_list_view/mod.ui b/src/session/view/content/room_details/members_page/members_list_view/mod.ui index 4ebc4511..b1c9ef60 100644 --- a/src/session/view/content/room_details/members_page/members_list_view/mod.ui +++ b/src/session/view/content/room_details/members_page/members_list_view/mod.ui @@ -17,7 +17,7 @@ - +