mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 21:26:43 +01:00
Process -> Audio; Layers2 -> Layers
This commit is contained in:
parent
1cbf8de4e4
commit
cd8a808c21
20 changed files with 334 additions and 414 deletions
|
|
@ -3,7 +3,10 @@ use crate::*;
|
|||
pub trait Widget: Send + Sync {
|
||||
type Engine: Engine;
|
||||
fn layout (&self, to: <<Self as Widget>::Engine as Engine>::Area) ->
|
||||
Perhaps<<<Self as Widget>::Engine as Engine>::Area>;
|
||||
Perhaps<<<Self as Widget>::Engine as Engine>::Area>
|
||||
{
|
||||
Ok(Some(to))
|
||||
}
|
||||
fn render (&self, to: &mut Self::Engine) ->
|
||||
Perhaps<<<Self as Widget>::Engine as Engine>::Area>;
|
||||
}
|
||||
|
|
@ -86,7 +89,10 @@ impl<E: Engine, W: Content<Engine = E>> Widget for W {
|
|||
self.content().layout(to)
|
||||
}
|
||||
fn render (&self, to: &mut E) -> Perhaps<E::Area> {
|
||||
self.content().render(to)
|
||||
match self.layout(to.area())? {
|
||||
Some(area) => to.render_in(area, &self.content()),
|
||||
None => Ok(None)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue