Add Text widget

This commit is contained in:
Joscha 2022-07-12 09:27:16 +02:00
parent f08f653bfc
commit 53a0f8d4af
4 changed files with 71 additions and 10 deletions

11
src/ui/widgets.rs Normal file
View file

@ -0,0 +1,11 @@
pub mod text;
use async_trait::async_trait;
use toss::frame::{Frame, Pos, Size};
#[async_trait]
pub trait Widget {
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size;
async fn render(&self, frame: &mut Frame, pos: Pos, size: Size);
}