members-page: Make sure search entry is focused after it is revealed
This commit is contained in:
parent
98a7fc4c42
commit
724c7deeff
2 changed files with 7 additions and 1 deletions
|
@ -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!(
|
||||
"{} {} {} {}",
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue