This commit is contained in:
Nathan Sobo 2023-05-13 14:34:09 -06:00
parent 6c60853842
commit ba50b35de6
9 changed files with 634 additions and 525 deletions

View file

@ -33,8 +33,11 @@ use crate::{
rect::RectF,
vector::{vec2f, Vector2F},
},
json, Action, LayoutContext, SceneBuilder, SizeConstraint, View, ViewContext, WeakViewHandle,
WindowContext,
json,
platform::MouseButton,
scene::MouseDown,
Action, EventContext, LayoutContext, SceneBuilder, SizeConstraint, View, ViewContext,
WeakViewHandle, WindowContext,
};
use anyhow::{anyhow, Result};
use collections::HashMap;
@ -198,6 +201,13 @@ pub trait Element<V: View>: 'static {
{
Resizable::new(self.into_any(), side, size, on_resize)
}
fn mouse<Tag>(self, region_id: usize) -> MouseEventHandler<Tag, V>
where
Self: Sized,
{
MouseEventHandler::for_child(self.into_any(), region_id)
}
}
trait AnyElementState<V: View> {