mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip: tui cleanup
This commit is contained in:
parent
df3dac183e
commit
14d619a10a
17 changed files with 345 additions and 306 deletions
20
crates/tek_core/src/component/layered.rs
Normal file
20
crates/tek_core/src/component/layered.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct Layered<'a, E: Engine>(pub Collection<'a, E>);
|
||||
|
||||
impl<'a, E: Engine> Layered<'a, E> {
|
||||
pub fn new () -> Self {
|
||||
Self(Collection::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, E: Engine> Collect<'a, E> for Layered<'a, E> {
|
||||
fn add_box (mut self, item: Box<dyn Render<E> + 'a>) -> Self {
|
||||
self.0 = self.0.add_box(item);
|
||||
self
|
||||
}
|
||||
fn add_ref (mut self, item: &'a dyn Render<E>) -> Self {
|
||||
self.0 = self.0.add_ref(item);
|
||||
self
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue