Struct nannou::ui::prelude::widget::Slider[][src]

pub struct Slider<'a, T> {
    pub skew: f32,
    pub enabled: bool,
    // some fields omitted
}

Linear value selection.

If the slider’s width is greater than it’s height, it will automatically become a horizontal slider, otherwise it will be a vertical slider.

Its reaction is triggered if the value is updated or if the mouse button is released while the cursor is above the rectangle.

Fields

skew: f32

The amount in which the slider’s display should be skewed.

Higher skew amounts (above 1.0) will weight lower values.

Lower skew amounts (below 1.0) will weight heigher values.

All skew amounts should be greater than 0.0.

enabled: bool

Whether or not user input is enabled for the Slider.

Implementations

impl<'a, T> Slider<'a, T>[src]

pub fn new(value: T, min: T, max: T) -> Slider<'a, T>[src]

Construct a new Slider widget.

pub fn label_font_id(self, font_id: Id) -> Slider<'a, T>[src]

Specify the font used for displaying the label.

pub fn skew(self, skew: f32) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

pub fn enabled(self, enabled: bool) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

Trait Implementations

impl<'a, T> Borderable for Slider<'a, T>[src]

pub fn border(self, border: f64) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

pub fn border_color(self, border_color: Color) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

impl<'a, T> Colorable for Slider<'a, T>[src]

pub fn color(self, color: Color) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

impl<'a, T> Common for Slider<'a, T>[src]

impl<'a, T> Labelable<'a> for Slider<'a, T>[src]

pub fn label(self, label: &'a str) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

pub fn label_color(self, label_color: Color) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

pub fn label_font_size(self, label_font_size: u32) -> Slider<'a, T>[src]

Build the type’s self.$($assignee).+ with the given $Type.

impl<'a, T> Widget for Slider<'a, T> where
    T: Float + NumCast + ToPrimitive
[src]

type State = State

State to be stored within the Uis widget cache. Read more

type Style = Style

Every widget is required to have its own associated Style type. This type is intended to contain high-level styling information for the widget that can be optionally specified by a user of the widget. Read more

type Event = Option<T>

The type of event yielded by the widget, returned via the Widget::set function. Read more

pub fn update(
    self,
    args: UpdateArgs<'_, '_, '_, '_, Slider<'a, T>>
) -> <Slider<'a, T> as Widget>::Event
[src]

Update the state of the Slider.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Slider<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Slider<'a, T> where
    T: Send

impl<'a, T> Sync for Slider<'a, T> where
    T: Sync

impl<'a, T> Unpin for Slider<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Slider<'a, T> where
    T: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> Downcast<T> for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<W> Positionable for W where
    W: Widget
[src]

impl<T> SetParameter for T

impl<W> Sizeable for W where
    W: Widget
[src]

pub fn get_x_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the x Dimension for the widget via the following:

  • Check for specified value at maybe_x_dimension
  • Otherwise, use the default returned by Widget::default_x_dimension.

pub fn get_y_dimension(&self, ui: &Ui) -> Dimension[src]

We attempt to retrieve the y Dimension for the widget via the following:

  • Check for specified value at maybe_y_dimension
  • Otherwise, use the default returned by Widget::default_y_dimension.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,