refactoring arranger into components

This commit is contained in:
🪞👃🪞 2024-09-12 19:24:21 +03:00
parent 0bc43ed36f
commit 5670fc179b
4 changed files with 262 additions and 288 deletions

View file

@ -582,10 +582,11 @@ impl<T: Widget<Engine = Tui>> Widget for Align<T> {
})
}
fn render (&self, to: &mut Tui) -> Perhaps<[u16;4]> {
self.layout(to.area())?
.map(|area|to.render_in(area, self.inner()))
.transpose()
.map(|x|x.flatten())
if let Some(area) = self.layout(to.area())? {
to.render_in(area, self.inner())
} else {
Ok(None)
}
}
}