From f65a4e3f4223ef9cd320cbb106097388c5ebe14d Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Wed, 5 Sep 2018 19:14:39 +0500 Subject: [PATCH] invite_user.ui: Clean up headerbar Use 'title' property for title, and pack buttons into the headerbar itself. --- fractal-gtk/res/ui/invite_user.ui | 74 ++++++++++--------------------- fractal-gtk/src/appop/invite.rs | 10 ++--- 2 files changed, 29 insertions(+), 55 deletions(-) diff --git a/fractal-gtk/res/ui/invite_user.ui b/fractal-gtk/res/ui/invite_user.ui index b871dd65..fd998cd1 100644 --- a/fractal-gtk/res/ui/invite_user.ui +++ b/fractal-gtk/res/ui/invite_user.ui @@ -108,60 +108,34 @@ - + True False - - + Invite + + + Cancel True - False - True - - - Cancel - True - True - True - - - False - True - 0 - - - - - True - False - True - Invite - - - - - - False - True - 1 - - - - - Invite - True - True - True - - - - False - True - 2 - - + True + True + + start + + + + + Invite + True + True + True + + + + end + diff --git a/fractal-gtk/src/appop/invite.rs b/fractal-gtk/src/appop/invite.rs index 85259ca8..a73a79ff 100644 --- a/fractal-gtk/src/appop/invite.rs +++ b/fractal-gtk/src/appop/invite.rs @@ -126,17 +126,17 @@ impl AppOp { let scroll = self.ui.builder .get_object::("user_search_scroll") .expect("Can't find user_search_scroll in ui file."); - let title = self.ui.builder - .get_object::("invite_title") - .expect("Can't find invite_title in ui file."); + let headerbar = self.ui.builder + .get_object::("invite_headerbar") + .expect("Can't find invite_headerbar in ui file."); self.search_type = SearchType::Invite; if let Some(aroom) = self.active_room.clone() { if let Some(r) = self.rooms.get(&aroom) { if let &Some(ref name) = &r.name { - title.set_text(&i18n_k("Invite to {name}", &[("name", name)])); + headerbar.set_title(i18n_k("Invite to {name}", &[("name", name)]).as_str()); } else { - title.set_text(i18n("Invite").as_str()); + headerbar.set_title(i18n("Invite").as_str()); } } }