pub struct Floating { /* private fields */ }Expand description
Where a panel sits, and where inside it the pointer took hold. A field of
the view that mounts the panel, like crate::scroll::ScrollbarState —
and, for the same reason, carrying its own Painter: a drag runs in
event-dispatch context, where the window cannot resolve which view is
asking to be redrawn.
Implementations§
Source§impl Floating
impl Floating
pub fn new(painter: Painter) -> Self
Sourcepub fn at(&self) -> Option<Point<Pixels>>
pub fn at(&self) -> Option<Point<Pixels>>
Where the panel sits, once it has been moved. Read it to persist a
position; hand it back with Self::move_to.
Sourcepub fn held(&self) -> bool
pub fn held(&self) -> bool
Whether the pointer is holding the panel, travelling or not — the closed hand.
Sourcepub fn dragging(&self) -> bool
pub fn dragging(&self) -> bool
Whether the panel is being moved, which a press alone is not — the lift, the shadow, whatever a host shows for a thing in flight.
pub fn move_to(&self, at: Point<Pixels>)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Floating
impl !Send for Floating
impl !Sync for Floating
impl !UnwindSafe for Floating
impl Freeze for Floating
impl Unpin for Floating
impl UnsafeUnpin for Floating
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