Skip to main content

ParamSlider

Struct ParamSlider 

Source
pub struct ParamSlider<'a, P: Param> { /* private fields */ }
Expand description

A slider widget similar to egui::widgets::Slider that knows about nice-plug parameters ranges and can get values for it. The slider supports double click and control click to reset, shift+drag for granular dragging, text value entry by clicking on the value text.

TODO: Vertical orientation TODO: Check below for more input methods that should be added TODO: Decouple the logic from the drawing so we can also do things like nobs without having to repeat everything TODO: Add WidgetInfo annotations for accessibility

Implementations§

Source§

impl<'a, P: Param> ParamSlider<'a, P>

Source

pub fn for_param(param: &'a P, setter: &'a ParamSetter<'a>) -> Self

Create a new slider for a parameter. Use the other methods to modify the slider before passing it to Ui::add().

Source

pub fn without_value(self) -> Self

Don’t draw the text slider’s current value after the slider.

Source

pub fn with_width(self, width: f32) -> Self

Set a custom width for the slider.

Trait Implementations§

Source§

impl<P: Param> Widget for ParamSlider<'_, P>

Source§

fn ui(self, ui: &mut Ui) -> Response

Allocate space, interact, paint, and return a Response. Read more

Auto Trait Implementations§

§

impl<'a, P> Freeze for ParamSlider<'a, P>

§

impl<'a, P> !RefUnwindSafe for ParamSlider<'a, P>

§

impl<'a, P> Send for ParamSlider<'a, P>
where P: Sync,

§

impl<'a, P> Sync for ParamSlider<'a, P>
where P: Sync,

§

impl<'a, P> Unpin for ParamSlider<'a, P>

§

impl<'a, P> UnsafeUnpin for ParamSlider<'a, P>

§

impl<'a, P> !UnwindSafe for ParamSlider<'a, P>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

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>,

Source§

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.