separate Input and Output impls

This commit is contained in:
🪞👃🪞 2025-01-05 22:01:54 +01:00
parent a6efde40f8
commit 0e821e098f
77 changed files with 465 additions and 454 deletions

19
tui/src/tui_content.rs Normal file
View file

@ -0,0 +1,19 @@
use crate::*;
impl Content<TuiOut> for &str {
fn layout (&self, to: [u16;4]) -> [u16;4] {
to.center_xy([self.chars().count() as u16, 1])
}
fn render (&self, to: &mut TuiOut) {
to.blit(self, to.area.x(), to.area.y(), None)
}
}
impl Content<TuiOut> for String {
fn layout (&self, to: [u16;4]) -> [u16;4] {
to.center_xy([self.chars().count() as u16, 1])
}
fn render (&self, to: &mut TuiOut) {
to.blit(self, to.area.x(), to.area.y(), None)
}
}