diff options
author | rabite <rabite@posteo.de> | 2019-03-19 01:08:22 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-03-19 14:38:15 +0100 |
commit | 161ba5ac3f38733b45c0167cb1e29f0be6059775 (patch) | |
tree | 794ec2517c71f6e6e3b9c572ebcc0e2fca66c3f4 /src/tabview.rs | |
parent | c719ec7a3cb6ca3d2346f48dc11d2e0d5ee10d36 (diff) |
handle terminal resizing
Diffstat (limited to 'src/tabview.rs')
-rw-r--r-- | src/tabview.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tabview.rs b/src/tabview.rs index e8dc748..524a469 100644 --- a/src/tabview.rs +++ b/src/tabview.rs @@ -2,6 +2,8 @@ use termion::event::Key; use crate::widget::{Widget, WidgetCore}; use crate::fail::{HResult, ErrorLog}; +use crate::coordinates::Coordinates; +use crate::dirty::Dirtyable; pub trait Tabbable { fn new_tab(&mut self) -> HResult<()>; @@ -105,6 +107,15 @@ impl<T> Widget for TabView<T> where T: Widget, TabView<T>: Tabbable { fn get_core_mut(&mut self) -> HResult<&mut WidgetCore> { Ok(&mut self.core) } + + fn set_coordinates(&mut self, coordinates: &Coordinates) -> HResult<()> { + self.core.coordinates = coordinates.clone(); + for widget in &mut self.widgets { + widget.set_coordinates(coordinates).log(); + } + Ok(()) + } + fn render_header(&self) -> HResult<String> { let xsize = self.get_coordinates()?.xsize(); let header = self.active_tab_().render_header()?; |