pub enum FileDropPhase {
Hover,
Drop,
Cancel,
Ended,
}Expand description
The file-drop vocabulary for handling file drops from the OS.
InputEvent::FileDrop carries a FileDropEvent, which embeds a
FileDropPhase (Hover, Drop, Cancel, or the broadcast-only Ended
that follows every Drop/Cancel) and the dropped file paths
(only on Drop). A widget handling drops is hit-tested and bubbles like
[InputEvent::Scroll]. Lifted flat for the same reason EditCommand is:
an app’s file-drop handler names these types in its public API without being
a widget author.
The phase of a desktop OS file drag entering, hovering over, dropping on,
or leaving the window — see InputEvent::FileDrop.
A shell publishes only the first three. Ended is
the root’s own broadcast follow-up to every Drop/Cancel, handled or
not — see FileDropEvent’s Broadcast follow-up section.
Variants§
Hover
The drag is hovering the window — it just entered, or moved while
still over it. Carries no paths; see FileDropEvent::paths.
Drop
The files were released over the window. Carries every dropped path.
Cancel
The drag left the window, or the OS otherwise called it off, without a drop. Carries no paths.
Ended
Broadcast-only, never sent by a shell: the OS drag is over — a
Drop or Cancel was just dispatched hit-tested, whether or not a
widget handled it — so crate::app::RenderRoot::event re-dispatches
this phase to every widget. Carries no paths and no meaningful
position (Point::ZERO, never translated). A widget holding state
the drag opened (a drop target’s external drag session) ends whatever
of it is still open here, so a release over a region nothing handles —
or over a widget other than the one whose state the drag opened —
still ends the drag everywhere.
Trait Implementations§
Source§impl Clone for FileDropPhase
impl Clone for FileDropPhase
Source§fn clone(&self) -> FileDropPhase
fn clone(&self) -> FileDropPhase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FileDropPhase
Source§impl Debug for FileDropPhase
impl Debug for FileDropPhase
impl Eq for FileDropPhase
Source§impl PartialEq for FileDropPhase
impl PartialEq for FileDropPhase
impl StructuralPartialEq for FileDropPhase
Auto Trait Implementations§
impl Freeze for FileDropPhase
impl RefUnwindSafe for FileDropPhase
impl Send for FileDropPhase
impl Sync for FileDropPhase
impl Unpin for FileDropPhase
impl UnsafeUnpin for FileDropPhase
impl UnwindSafe for FileDropPhase
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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.