[][src]Struct egui::widgets::Slider

#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]pub struct Slider<'a> { /* fields omitted */ }

Control a number by a horizontal slider. The range can include any numbers, and go from low-to-high or from high-to-low.

Implementations

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

pub fn from_get_set(
    range: RangeInclusive<f64>,
    get_set_value: impl 'a + FnMut(Option<f64>) -> f64
) -> Self
[src]

pub fn f32(value: &'a mut f32, range: RangeInclusive<f32>) -> Self[src]

pub fn f64(value: &'a mut f64, range: RangeInclusive<f64>) -> Self[src]

pub fn u8(value: &'a mut u8, range: RangeInclusive<u8>) -> Self[src]

pub fn i32(value: &'a mut i32, range: RangeInclusive<i32>) -> Self[src]

pub fn u32(value: &'a mut u32, range: RangeInclusive<u32>) -> Self[src]

pub fn usize(value: &'a mut usize, range: RangeInclusive<usize>) -> Self[src]

pub fn text(mut self: Self, text: impl Into<String>) -> Self[src]

pub fn text_color(mut self: Self, text_color: Color32) -> Self[src]

pub fn logarithmic(mut self: Self, logarithmic: bool) -> Self[src]

Make this a logarithmic slider. This is great for when the slider spans a huge range, e.g. from one to a million. The default is OFF.

pub fn smallest_positive(mut self: Self, smallest_positive: f64) -> Self[src]

For logarithmic sliders that includes zero: what is the smallest positive value you want to be able to select? The default is 1 for integer sliders and 1e-6 for real sliders.

pub fn smart_aim(mut self: Self, smart_aim: bool) -> Self[src]

Turn smart aim on/off. Default is ON. There is almost no point in turning this off.

pub fn precision(self, precision: usize) -> Self[src]

👎 Deprecated:

Use fixed_decimals instead

pub fn min_decimals(mut self: Self, min_decimals: usize) -> Self[src]

Set a minimum number of decimals to display. Normally you don't need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use "smart aim" to help the user select nice, round values.

pub fn max_decimals(mut self: Self, max_decimals: usize) -> Self[src]

Set a maximum number of decimals to display. Values will also be rounded to this number of decimals. Normally you don't need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use "smart aim" to help the user select nice, round values.

pub fn fixed_decimals(mut self: Self, num_decimals: usize) -> Self[src]

Set an exact number of decimals to display. Values will also be rounded to this number of decimals. Normally you don't need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use "smart aim" to help the user select nice, round values.

pub fn integer(self) -> Self[src]

Helper: equivalent to self.precision(0).smallest_positive(1.0). If you use one of the integer constructors (e.g. Slider::i32) this is called for you, but if you want to have a slider for picking integer values in an Slider::f64, use this.

Trait Implementations

impl<'a> Widget for Slider<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Slider<'a>[src]

impl<'a> !Send for Slider<'a>[src]

impl<'a> !Sync for Slider<'a>[src]

impl<'a> Unpin for Slider<'a>[src]

impl<'a> !UnwindSafe for Slider<'a>[src]

Blanket Implementations

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> From<T> for T[src]

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

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.