mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
wip: impl_draw, optional drawing
This commit is contained in:
parent
0b9e9c0696
commit
bf16288884
12 changed files with 213 additions and 229 deletions
|
|
@ -23,7 +23,7 @@ pub const fn border (on: bool, style: impl BorderStyle, draw: impl Draw<Tui>) ->
|
|||
to.blit(&style.border_e(), x + w - 1, y, style.style());
|
||||
}
|
||||
}
|
||||
Ok(XYWH(x, y, w, h))
|
||||
Ok(Some(XYWH(x, y, w, h)))
|
||||
}));
|
||||
above(outline, content)
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ macro_rules! border {
|
|||
#[derive(Copy, Clone)] pub struct $T(pub bool, pub Style);
|
||||
//impl Layout<Tui> for $T {}
|
||||
impl Draw<Tui> for $T {
|
||||
fn draw (self, to: &mut Tui) -> Usually<XYWH<u16>> {
|
||||
fn draw (self, to: &mut Tui) -> Perhaps<XYWH<u16>> {
|
||||
when(self.enabled(), thunk(|to: &mut Tui|BorderStyle::draw(self, to))).draw(to)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue