Refine naming of element-related types and traits

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Nathan Sobo 2023-04-21 13:04:03 -06:00
parent 03619dfa55
commit fe492eacbf
93 changed files with 661 additions and 656 deletions

View file

@ -3,12 +3,12 @@ use std::ops::Range;
use crate::{
geometry::{rect::RectF, vector::Vector2F},
json::ToJson,
Axis, Drawable, Element, MouseRegion, SceneBuilder, SizeConstraint, View, ViewContext,
AnyElement, Axis, Element, MouseRegion, SceneBuilder, SizeConstraint, View, ViewContext,
};
use serde_json::json;
pub struct Overlay<V: View> {
child: Element<V>,
child: AnyElement<V>,
anchor_position: Option<Vector2F>,
anchor_corner: AnchorCorner,
fit_mode: OverlayFitMode,
@ -73,9 +73,9 @@ impl AnchorCorner {
}
impl<V: View> Overlay<V> {
pub fn new(child: impl Drawable<V>) -> Self {
pub fn new(child: impl Element<V>) -> Self {
Self {
child: child.into_element(),
child: child.into_any(),
anchor_position: None,
anchor_corner: AnchorCorner::TopLeft,
fit_mode: OverlayFitMode::None,
@ -116,7 +116,7 @@ impl<V: View> Overlay<V> {
}
}
impl<V: View> Drawable<V> for Overlay<V> {
impl<V: View> Element<V> for Overlay<V> {
type LayoutState = Vector2F;
type PaintState = ();