Merge branch 'main' into disclosable-component
This commit is contained in:
@@ -10,8 +10,7 @@ use crate::{
|
||||
json::ToJson,
|
||||
platform::CursorStyle,
|
||||
scene::{self, Border, CornerRadii, CursorRegion, Quad},
|
||||
AnyElement, Element, LayoutContext, PaintContext, SceneBuilder, SizeConstraint, View,
|
||||
ViewContext,
|
||||
AnyElement, Element, LayoutContext, PaintContext, SceneBuilder, SizeConstraint, ViewContext,
|
||||
};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
@@ -55,12 +54,12 @@ impl ContainerStyle {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Container<V: View> {
|
||||
pub struct Container<V> {
|
||||
child: AnyElement<V>,
|
||||
style: ContainerStyle,
|
||||
}
|
||||
|
||||
impl<V: View> Container<V> {
|
||||
impl<V> Container<V> {
|
||||
pub fn new(child: AnyElement<V>) -> Self {
|
||||
Self {
|
||||
child,
|
||||
@@ -207,7 +206,7 @@ impl<V: View> Container<V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<V: View> Element<V> for Container<V> {
|
||||
impl<V: 'static> Element<V> for Container<V> {
|
||||
type LayoutState = ();
|
||||
type PaintState = ();
|
||||
|
||||
@@ -358,8 +357,8 @@ impl ToJson for ContainerStyle {
|
||||
#[derive(Clone, Copy, Debug, Default, JsonSchema)]
|
||||
pub struct Margin {
|
||||
pub top: f32,
|
||||
pub left: f32,
|
||||
pub bottom: f32,
|
||||
pub left: f32,
|
||||
pub right: f32,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user