mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-19 13:36:42 +02:00
moar flat
This commit is contained in:
parent
fc01fd6ad3
commit
a27dacff93
29 changed files with 649 additions and 582 deletions
|
|
@ -5,9 +5,9 @@ use super::{*, draw::*};
|
|||
/// ```
|
||||
/// /// TODO
|
||||
/// ```
|
||||
pub fn border (on: bool, style: impl BorderStyle, draw: impl Draw<Tui>) -> impl Draw<Tui> {
|
||||
let content = draw.pad_wh(1, 1);
|
||||
let outline = when(on, thunk(move|to: &mut Tui|{
|
||||
pub fn border (on: bool, style: impl BorderStyle, item: impl Draw<Tui>) -> impl Draw<Tui> {
|
||||
let content = item.pad_wh(1, 1);
|
||||
let outline = when(on, draw(move|to: &mut Tui|{
|
||||
let XYWH(x, y, w, h) = to.1;
|
||||
if w > 0 && h > 0 {
|
||||
to.blit(&style.border_nw(), x, y, style.style());
|
||||
|
|
@ -49,7 +49,7 @@ macro_rules! border {
|
|||
//impl Layout<Tui> for $T {}
|
||||
impl Draw<Tui> for $T {
|
||||
fn draw (self, to: &mut Tui) -> Perhaps<XYWH<u16>> {
|
||||
when(self.enabled(), thunk(|to: &mut Tui|BorderStyle::draw(self, to).map(Some))).draw(to)
|
||||
when(self.enabled(), draw(|to: &mut Tui|BorderStyle::draw(self, to).map(Some))).draw(to)
|
||||
}
|
||||
}
|
||||
)+}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue