WIP
This commit is contained in:
parent
45a8aea0f0
commit
db15db45ce
2 changed files with 6 additions and 6 deletions
|
@ -3,7 +3,7 @@ use derive_more::{Deref, DerefMut};
|
|||
pub(crate) use smallvec::SmallVec;
|
||||
use std::{any::Any, mem};
|
||||
|
||||
pub trait Element<V: 'static>: IntoAnyElement<V> {
|
||||
pub trait Element<V: 'static> {
|
||||
type ElementState: 'static;
|
||||
|
||||
fn id(&self) -> Option<ElementId>;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
point, px, view, Action, AnyBox, AnyDrag, AppContext, BorrowWindow, Bounds, DispatchContext,
|
||||
DispatchPhase, Element, ElementId, FocusHandle, KeyMatch, Keystroke, Modifiers, Overflow,
|
||||
Pixels, Point, SharedString, Size, Style, StyleRefinement, ViewContext,
|
||||
DispatchPhase, Element, ElementId, FocusHandle, IntoAnyElement, KeyMatch, Keystroke, Modifiers,
|
||||
Overflow, Pixels, Point, SharedString, Size, Style, StyleRefinement, ViewContext,
|
||||
};
|
||||
use collections::HashMap;
|
||||
use derive_more::{Deref, DerefMut};
|
||||
|
@ -327,7 +327,7 @@ pub trait StatefulInteractive<V: 'static>: StatelessInteractive<V> {
|
|||
S: Any + Send + Sync,
|
||||
R: Fn(&mut V, &mut ViewContext<V>) -> E,
|
||||
R: 'static + Send + Sync,
|
||||
E: Element<V>,
|
||||
E: IntoAnyElement<V>,
|
||||
{
|
||||
debug_assert!(
|
||||
self.stateful_interaction().drag_listener.is_none(),
|
||||
|
@ -871,7 +871,7 @@ pub struct Drag<S, R, V, E>
|
|||
where
|
||||
R: Fn(&mut V, &mut ViewContext<V>) -> E,
|
||||
V: 'static,
|
||||
E: Element<V>,
|
||||
E: IntoAnyElement<V>,
|
||||
{
|
||||
pub state: S,
|
||||
pub render_drag_handle: R,
|
||||
|
@ -882,7 +882,7 @@ impl<S, R, V, E> Drag<S, R, V, E>
|
|||
where
|
||||
R: Fn(&mut V, &mut ViewContext<V>) -> E,
|
||||
V: 'static,
|
||||
E: Element<V>,
|
||||
E: IntoAnyElement<V>,
|
||||
{
|
||||
pub fn new(state: S, render_drag_handle: R) -> Self {
|
||||
Drag {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue