members-page: Make sure search entry is focused after it is revealed

This commit is contained in:
Kévin Commaille 2023-11-15 14:17:30 +01:00
parent 98a7fc4c42
commit 724c7deeff
No known key found for this signature in database
GPG key ID: 29A48C1F03620416
2 changed files with 7 additions and 1 deletions

View file

@ -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<gtk::SearchBar>,
#[template_child]
pub search_entry: TemplateChild<gtk::SearchEntry>,
#[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!(
"{} {} {} {}",

View file

@ -17,7 +17,7 @@
</object>
</child>
<child type="top">
<object class="GtkSearchBar">
<object class="GtkSearchBar" id="search_bar">
<property name="search-mode-enabled" bind-source="search_button" bind-property="active"/>
<property name="child">
<object class="AdwClamp">