Struct egui_dnd::Handle

source ·
pub struct Handle<'a> { /* private fields */ }
Expand description

Handle::ui is used to draw the drag handle

Implementations§

source§

impl<'a> Handle<'a>

source

pub fn sense(self, sense: Sense) -> Self

You can add Sense::click if you want to listen for clicks on the handle Warning: This will make anything sensing clicks in the handle not draggable Make sure to not set this if your handle consists of a single button, and directly query the button for clicks.

source

pub fn show_drag_cursor_on_hover(self, show: bool) -> Self

If true, the cursor will change to a grab cursor when hovering over the handle This is true by default

source

pub fn enable_selectable_labels(self) -> Self

By default, selectable labels are disabled in the handle, to not interfere with dragging. You can use this to re-enable them. Note that if you disable selectable labels globally, this won’t have any effect.

source

pub fn ui(self, ui: &mut Ui, contents: impl FnOnce(&mut Ui)) -> Response

Draw the drag handle. Use Handle::sense to add a click sense. You can also add buttons in the handle, but they won’t be interactive if you pass Sense::click

source

pub fn ui_sized( self, ui: &mut Ui, size: Vec2, add_contents: impl FnOnce(&mut Ui) ) -> Response

This is useful if you want to sort items in a horizontal_wrapped. This doesn’t create a new scope.

Auto Trait Implementations§

§

impl<'a> Freeze for Handle<'a>

§

impl<'a> RefUnwindSafe for Handle<'a>

§

impl<'a> Send for Handle<'a>

§

impl<'a> Sync for Handle<'a>

§

impl<'a> Unpin for Handle<'a>

§

impl<'a> !UnwindSafe for Handle<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.