pub struct Domain<R, I>(/* private fields */);Expand description
Gesture and animation state for the regions items move between.
Implementations§
Source§impl<R: Clone + PartialEq + 'static, I: Clone + PartialEq + 'static> Domain<R, I>
impl<R: Clone + PartialEq + 'static, I: Clone + PartialEq + 'static> Domain<R, I>
Sourcepub fn new(painter: Painter) -> Self
pub fn new(painter: Painter) -> Self
The carried item is painted in place, following the pointer.
Sourcepub fn with_ghost(
painter: Painter,
ghost: impl Fn(&I, &mut Window, &mut App) -> AnyElement + 'static,
) -> Self
pub fn with_ghost( painter: Painter, ghost: impl Fn(&I, &mut Window, &mut App) -> AnyElement + 'static, ) -> Self
The carried item’s own element stays hidden in its slot and gpui paints
ghost under the pointer instead. For virtualized regions, where the
item’s element can scroll out of the painted range.
Sourcepub fn region(
&self,
element_id: impl Into<ElementId>,
id: R,
axis: Axis,
child: impl IntoElement,
) -> Region<R, I>
pub fn region( &self, element_id: impl Into<ElementId>, id: R, axis: Axis, child: impl IntoElement, ) -> Region<R, I>
A drop target laid out by the host. child holds this region’s handles.
Sourcepub fn handle<E>(&self, item: I, element: E) -> Handle<R, I>where
E: StatefulInteractiveElement + IntoElement + 'static,
pub fn handle<E>(&self, item: I, element: E) -> Handle<R, I>where
E: StatefulInteractiveElement + IntoElement + 'static,
Makes element pickable as item. Item ids are unique within a domain.
Custom controls inside it stop mouse-down propagation to keep their
presses from starting a drag.
Sourcepub fn fixed(&self, item: I, element: impl IntoElement) -> Handle<R, I>
pub fn fixed(&self, item: I, element: impl IntoElement) -> Handle<R, I>
An item that is measured and moves aside like a handle but cannot be picked up, such as a heading between sections.
Trait Implementations§
Auto Trait Implementations§
impl<R, I> !RefUnwindSafe for Domain<R, I>
impl<R, I> !Send for Domain<R, I>
impl<R, I> !Sync for Domain<R, I>
impl<R, I> !UnwindSafe for Domain<R, I>
impl<R, I> Freeze for Domain<R, I>
impl<R, I> Unpin for Domain<R, I>
impl<R, I> UnsafeUnpin for Domain<R, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more