Add Text widget
This commit is contained in:
parent
f08f653bfc
commit
53a0f8d4af
4 changed files with 71 additions and 10 deletions
11
src/ui/widgets.rs
Normal file
11
src/ui/widgets.rs
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue