mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: migrating to Widget trait
This commit is contained in:
parent
b944dd5f9e
commit
c4a5ee7b6e
4 changed files with 130 additions and 161 deletions
|
|
@ -96,16 +96,12 @@ pub trait Content {
|
|||
//()
|
||||
//}
|
||||
//}
|
||||
impl<W> Widget for W where W: Content {
|
||||
type Engine = <Self as Content>::Engine;
|
||||
fn layout (&self, to: <<Self as Content>::Engine as Engine>::Area)
|
||||
-> Perhaps<<<Self as Content>::Engine as Engine>::Area>
|
||||
{
|
||||
impl<E: Engine, W> Widget for W where W: Content<Engine = E> {
|
||||
type Engine = E;
|
||||
fn layout (&self, to: E::Area) -> Perhaps<E::Area> {
|
||||
self.content().layout(to)
|
||||
}
|
||||
fn render (&self, to: &mut <Self as Content>::Engine)
|
||||
-> Perhaps<<<Self as Content>::Engine as Engine>::Area>
|
||||
{
|
||||
fn render (&self, to: &mut E) -> Perhaps<E::Area> {
|
||||
self.content().render(to)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue