pub struct Drag<T, L, F = &'static str> { /* private fields */ }
Expand description
Builder for a drag slider widget.
Implementations§
Source§impl<L, T, F> Drag<T, L, F>
impl<L, T, F> Drag<T, L, F>
Sourcepub fn speed(self, speed: f32) -> Drag<T, L, F>
pub fn speed(self, speed: f32) -> Drag<T, L, F>
Sets the value increment for a movement of one pixel.
Example: speed=0.2 means mouse needs to move 5 pixels to increase the slider value by 1
Sourcepub fn display_format<F2>(self, display_format: F2) -> Drag<T, L, F2>
pub fn display_format<F2>(self, display_format: F2) -> Drag<T, L, F2>
Sets the display format using a C-style printf string
Sourcepub fn flags(self, flags: SliderFlags) -> Drag<T, L, F>
pub fn flags(self, flags: SliderFlags) -> Drag<T, L, F>
Replaces all current settings with the given flags
Sourcepub fn build(self, ui: &Ui, value: &mut T) -> bool
pub fn build(self, ui: &Ui, value: &mut T) -> bool
Builds a drag slider that is bound to the given value.
Returns true if the slider value was changed.
Sourcepub fn build_array(self, ui: &Ui, values: &mut [T]) -> bool
pub fn build_array(self, ui: &Ui, values: &mut [T]) -> bool
Builds a horizontal array of multiple drag sliders attached to the given slice.
Returns true if any slider value was changed.
Trait Implementations§
impl<T, L, F> Copy for Drag<T, L, F>
Auto Trait Implementations§
impl<T, L, F> Freeze for Drag<T, L, F>
impl<T, L, F> RefUnwindSafe for Drag<T, L, F>
impl<T, L, F> Send for Drag<T, L, F>
impl<T, L, F> Sync for Drag<T, L, F>
impl<T, L, F> Unpin for Drag<T, L, F>
impl<T, L, F> UnwindSafe for Drag<T, L, F>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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