make sure the title is set for the regular and chained method

This commit is contained in:
Henrik Friedrichsen
2019-03-09 01:11:25 +01:00
parent 2162a52544
commit 2bc87d8af5

View File

@@ -39,12 +39,12 @@ impl Layout {
view: view.as_boxed_view(), view: view.as_boxed_view(),
}; };
self.views.insert(s.clone(), screen); self.views.insert(s.clone(), screen);
self.title = title.to_owned();
self.focus = Some(s); self.focus = Some(s);
} }
pub fn view<S: Into<String>, T: IntoBoxedView>(mut self, id: S, view: T, title: &str) -> Self { pub fn view<S: Into<String>, T: IntoBoxedView>(mut self, id: S, view: T, title: &str) -> Self {
(&mut self).add_view(id, view, title); (&mut self).add_view(id, view, title);
self.title = title.to_owned();
self self
} }