mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 14:16:56 +02:00
add ShowSize
This commit is contained in:
parent
815bfe9379
commit
dee3d33453
1 changed files with 14 additions and 0 deletions
|
|
@ -29,3 +29,17 @@ impl Sizer {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ShowSize;
|
||||
|
||||
impl Draw<Tui> for ShowSize {
|
||||
fn layout (&self, area: XYWH<u16>) -> Perhaps<XYWH<u16>> {
|
||||
let info = format!("{area:?}");
|
||||
Ok(Some(XYWH(area.0, area.1, info.len() as u16, 1)))
|
||||
}
|
||||
fn draw (self, to: &mut Tui) -> Drawn<u16> {
|
||||
let area = to.area();
|
||||
let info = format!("{area:?}");
|
||||
to.text(&info, area.0, area.1, info.len() as u16)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue