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/hbox.rs | |
parent | c719ec7a3cb6ca3d2346f48dc11d2e0d5ee10d36 (diff) |
handle terminal resizing
Diffstat (limited to 'src/hbox.rs')
-rw-r--r-- | src/hbox.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/hbox.rs b/src/hbox.rs index 7982333..49b9c47 100644 --- a/src/hbox.rs +++ b/src/hbox.rs @@ -118,6 +118,12 @@ impl<T> Widget for HBox<T> where T: Widget + PartialEq { 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(); + self.resize_children() + } + fn render_header(&self) -> HResult<String> { self.active_widget().render_header() } @@ -125,7 +131,7 @@ impl<T> Widget for HBox<T> where T: Widget + PartialEq { fn refresh(&mut self) -> HResult<()> { self.resize_children().log(); for child in &mut self.widgets { - child.refresh()? + child.refresh().log(); } Ok(()) } |