pub struct DragPreviewConfig {
pub opacity: f32,
pub offset_x: i16,
pub offset_y: i16,
pub width: u16,
pub height: u16,
pub background: Option<PackedRgba>,
pub show_border: bool,
}Expand description
Configuration for the drag preview overlay.
Controls visual properties of the widget shown at the cursor during a drag.
Fields§
§opacity: f32Opacity of the preview widget (0.0 = invisible, 1.0 = fully opaque). Default: 0.7.
offset_x: i16Horizontal offset from cursor position in cells. Default: 1.
offset_y: i16Vertical offset from cursor position in cells. Default: 1.
width: u16Width of the preview area in cells. Default: 20.
height: u16Height of the preview area in cells. Default: 1.
background: Option<PackedRgba>Background color for the preview area.
show_border: boolWhether to render a border around the preview. Default: false.
Implementations§
Source§impl DragPreviewConfig
impl DragPreviewConfig
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set opacity (clamped to 0.0..=1.0).
Sourcepub fn with_offset(self, x: i16, y: i16) -> Self
pub fn with_offset(self, x: i16, y: i16) -> Self
Set cursor offset.
Sourcepub fn with_background(self, color: PackedRgba) -> Self
pub fn with_background(self, color: PackedRgba) -> Self
Set background color.
Sourcepub fn with_border(self) -> Self
pub fn with_border(self) -> Self
Enable border rendering.
Trait Implementations§
Source§impl Clone for DragPreviewConfig
impl Clone for DragPreviewConfig
Source§fn clone(&self) -> DragPreviewConfig
fn clone(&self) -> DragPreviewConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DragPreviewConfig
impl Debug for DragPreviewConfig
Auto Trait Implementations§
impl Freeze for DragPreviewConfig
impl RefUnwindSafe for DragPreviewConfig
impl Send for DragPreviewConfig
impl Sync for DragPreviewConfig
impl Unpin for DragPreviewConfig
impl UnwindSafe for DragPreviewConfig
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