mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
separate viewing/playing phrase + format
This commit is contained in:
parent
6f91eb085d
commit
ae60b792d6
4 changed files with 127 additions and 138 deletions
|
|
@ -367,6 +367,18 @@ impl Widget for &str {
|
|||
Ok(to.blit(&self, x, y, None))
|
||||
}
|
||||
}
|
||||
impl Widget for String {
|
||||
type Engine = Tui;
|
||||
fn layout (&self, _: [u16;2]) -> Perhaps<[u16;2]> {
|
||||
// TODO: line breaks
|
||||
Ok(Some([self.chars().count() as u16, 1]))
|
||||
}
|
||||
fn render (&self, to: &mut TuiOutput) -> Usually<()> {
|
||||
let [x, y, ..] = to.area();
|
||||
//let [w, h] = self.layout(to.area().wh())?.unwrap();
|
||||
Ok(to.blit(&self, x, y, None))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Widget<Engine = Tui>> Widget for DebugOverlay<Tui, T> {
|
||||
type Engine = Tui;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue