move Layout trait to separate module
Some checks failed
/ build (push) Has been cancelled

- output: impl Layout for Measure, FieldH, FieldV
- tui: enable #[feature(trait_alias)]
- tui: define some trait aliases
This commit is contained in:
🪞👃🪞 2025-09-09 20:59:07 +03:00
parent 90fc869e14
commit 731f4a971e
13 changed files with 166 additions and 147 deletions

View file

@ -15,7 +15,7 @@ impl<O: Out, T: Layout<O>> Layout<O> for When<O, T> {
impl<O: Out, T: Content<O>> Draw<O> for When<O, T> {
fn draw (&self, to: &mut O) {
let Self(cond, item, ..) = self;
if *cond { Bound(self.layout(to.area()), item).draw(to) }
if *cond { Bounded(self.layout(to.area()), item).draw(to) }
}
}
@ -37,7 +37,7 @@ impl<E: Out, A: Content<E>, B: Content<E>> Draw<E> for Either<E, A, B> {
fn draw (&self, to: &mut E) {
let Self(cond, a, b, ..) = self;
let area = self.layout(to.area());
if *cond { Bound(area, a).draw(to) } else { Bound(area, b).draw(to) }
if *cond { Bounded(area, a).draw(to) } else { Bounded(area, b).draw(to) }
}
}