Merge branch 'main' into derive-element-redux

This commit is contained in:
Conrad Irwin 2023-11-20 09:15:38 -07:00
commit 0798cfd58c
117 changed files with 7260 additions and 2951 deletions

View file

@ -179,6 +179,10 @@ impl AnyView {
self.model.entity_type
}
pub fn entity_id(&self) -> EntityId {
self.model.entity_id()
}
pub(crate) fn draw(
&self,
origin: Point<Pixels>,
@ -309,18 +313,6 @@ impl<V: 'static + Render<V>> From<WeakView<V>> for AnyWeakView {
}
}
impl<F, E> Render<F> for F
where
F: 'static + FnMut(&mut WindowContext) -> E,
E: 'static + Send + Element<F>,
{
type Element = E;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
(self)(cx)
}
}
pub struct RenderViewWith<E, V> {
view: View<V>,
element: Option<E>,