pub struct DropZone<F = fn(DragData) -> bool>{ /* private fields */ }Expand description
Drop zone widget
Implementations§
Source§impl<F> DropZone<F>
impl<F> DropZone<F>
Sourcepub fn accepts_all(self) -> Self
pub fn accepts_all(self) -> Self
Accept all data types
Sourcepub fn style(self, style: DropZoneStyle) -> Self
pub fn style(self, style: DropZoneStyle) -> Self
Set visual style
Sourcepub fn border_color(self, color: Color) -> Self
pub fn border_color(self, color: Color) -> Self
Set border color
Sourcepub fn hover_color(self, color: Color) -> Self
pub fn hover_color(self, color: Color) -> Self
Set hover color
Sourcepub fn min_height(self, height: u16) -> Self
pub fn min_height(self, height: u16) -> Self
Set minimum height
Sourcepub fn set_hovered(&mut self, hovered: bool, can_accept: bool)
pub fn set_hovered(&mut self, hovered: bool, can_accept: bool)
Set hovered state (called by drag system)
Sourcepub fn as_target(&self, bounds: Rect) -> DropTarget
pub fn as_target(&self, bounds: Rect) -> DropTarget
Create a DropTarget for registration
Source§impl DropZone<fn(DragData) -> bool>
impl DropZone<fn(DragData) -> bool>
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Check if the widget is focused
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if the widget is disabled
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set the focused state (mutable)
Trait Implementations§
Source§impl<F> Draggable for DropZone<F>
impl<F> Draggable for DropZone<F>
Source§fn accepted_types(&self) -> &[&'static str]
fn accepted_types(&self) -> &[&'static str]
Get the types this widget accepts for drops Read more
Source§fn on_drag_enter(&mut self, data: &DragData)
fn on_drag_enter(&mut self, data: &DragData)
Called when a drag enters this widget’s bounds
Source§fn on_drag_leave(&mut self)
fn on_drag_leave(&mut self)
Called when a drag leaves this widget’s bounds
Source§fn on_drop(&mut self, data: DragData) -> bool
fn on_drop(&mut self, data: DragData) -> bool
Called when a drop occurs on this widget Read more
Source§fn on_drag_start(&mut self)
fn on_drag_start(&mut self)
Called when drag starts
Source§fn on_drag_end(&mut self, _result: DropResult)
fn on_drag_end(&mut self, _result: DropResult)
Called when drag ends (regardless of outcome)
Source§fn can_accept(&self, data: &DragData) -> bool
fn can_accept(&self, data: &DragData) -> bool
Check if this widget can accept specific drag data
Source§impl StyledView for DropZone<fn(DragData) -> bool>
impl StyledView for DropZone<fn(DragData) -> bool>
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Source§impl<F> View for DropZone<F>
impl<F> View for DropZone<F>
Source§fn render(&self, ctx: &mut RenderContext<'_>)
fn render(&self, ctx: &mut RenderContext<'_>)
Render the view to the given context Read more
Source§fn meta(&self) -> WidgetMeta
fn meta(&self) -> WidgetMeta
Get widget metadata for DOM Read more
Source§fn widget_type(&self) -> &'static str
fn widget_type(&self) -> &'static str
Get widget type name (for CSS type selectors) Read more
Auto Trait Implementations§
impl<F> Freeze for DropZone<F>where
F: Freeze,
impl<F> RefUnwindSafe for DropZone<F>where
F: RefUnwindSafe,
impl<F> Send for DropZone<F>where
F: Send,
impl<F> Sync for DropZone<F>where
F: Sync,
impl<F> Unpin for DropZone<F>where
F: Unpin,
impl<F> UnsafeUnpin for DropZone<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for DropZone<F>where
F: UnwindSafe,
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