[−][src]Struct egui::widgets::Slider
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]
range: RangeInclusive<f64>,
get_set_value: impl 'a + FnMut(Option<f64>) -> f64
) -> Self
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(self, text: impl Into<String>) -> Self
[src]
pub fn text_color(self, text_color: Srgba) -> Self
[src]
pub fn logarithmic(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(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(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]
Precision (number of decimals) used when displaying the value. Values will also be rounded to this precision. 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
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Slider<'a>
impl<'a> !Send for Slider<'a>
impl<'a> !Sync for Slider<'a>
impl<'a> Unpin for Slider<'a>
impl<'a> !UnwindSafe for Slider<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,