Begin the widgetization

This commit is contained in:
Joscha 2022-07-11 23:30:16 +02:00
parent 717ac4c47a
commit f08f653bfc
2 changed files with 10 additions and 0 deletions

View file

@ -4,6 +4,7 @@ mod list;
mod room;
mod rooms;
mod util;
mod widget;
use std::sync::{Arc, Weak};
use std::time::Duration;

9
src/ui/widget.rs Normal file
View file

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