WIP
This commit is contained in:
+11
-1
@@ -3,7 +3,8 @@ use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use gpui3::{
|
||||
BorrowAppContext, Bounds, Element, Hsla, LayoutId, Pixels, Result, ViewContext, WindowContext,
|
||||
AnyElement, BorrowAppContext, Bounds, Element, Hsla, IntoAnyElement, LayoutId, Pixels, Result,
|
||||
ViewContext, WindowContext,
|
||||
};
|
||||
use serde::{de::Visitor, Deserialize, Deserializer};
|
||||
|
||||
@@ -146,6 +147,15 @@ pub struct Themed<E> {
|
||||
pub(crate) child: E,
|
||||
}
|
||||
|
||||
impl<E> IntoAnyElement<E::ViewState> for Themed<E>
|
||||
where
|
||||
E: Element,
|
||||
{
|
||||
fn into_any(self) -> AnyElement<E::ViewState> {
|
||||
AnyElement::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: Element> Element for Themed<E> {
|
||||
type ViewState = E::ViewState;
|
||||
type ElementState = E::ElementState;
|
||||
|
||||
Reference in New Issue
Block a user