Simplify adapter

This commit is contained in:
Nathan Sobo 2023-08-14 09:26:35 -06:00
parent 85f35497b6
commit 7756497933
6 changed files with 81 additions and 93 deletions

View file

@ -1461,6 +1461,7 @@ impl ToJson for SizeConstraint {
}
}
#[derive(Clone)]
pub struct ChildView {
view_id: usize,
view_name: &'static str,

View file

@ -33,8 +33,8 @@ use crate::{
rect::RectF,
vector::{vec2f, Vector2F},
},
json, Action, LayoutContext, PaintContext, SceneBuilder, SizeConstraint, View, ViewContext,
WeakViewHandle, WindowContext,
json, Action, Entity, LayoutContext, PaintContext, SceneBuilder, SizeConstraint, View,
ViewContext, WeakViewHandle, WindowContext,
};
use anyhow::{anyhow, Result};
use collections::HashMap;
@ -564,6 +564,12 @@ impl<V: 'static> Element<V> for AnyElement<V> {
}
}
impl Entity for AnyElement<()> {
type Event = ();
}
// impl View for AnyElement<()> {}
pub struct RootElement<V> {
element: AnyElement<V>,
view: WeakViewHandle<V>,