pub struct SliderState { /* private fields */ }Expand description
State of the Slider.
Implementations§
Source§impl SliderState
impl SliderState
Sourcepub fn new() -> SliderState
pub fn new() -> SliderState
Create a new SliderState.
Sourcepub fn min(self, min: f32) -> SliderState
pub fn min(self, min: f32) -> SliderState
Set the minimum value of the slider, default: 0.0
Sourcepub fn max(self, max: f32) -> SliderState
pub fn max(self, max: f32) -> SliderState
Set the maximum value of the slider, default: 100.0
Sourcepub fn step(self, step: f32) -> SliderState
pub fn step(self, step: f32) -> SliderState
Set the step value of the slider, default: 1.0
Sourcepub fn scale(self, scale: SliderScale) -> SliderState
pub fn scale(self, scale: SliderScale) -> SliderState
Set the scale of the slider, default: SliderScale::Linear.
Sourcepub fn default_value(self, value: impl Into<SliderValue>) -> SliderState
pub fn default_value(self, value: impl Into<SliderValue>) -> SliderState
Set the default value of the slider, default: 0.0
Sourcepub fn set_value(
&mut self,
value: impl Into<SliderValue>,
_: &mut Window,
cx: &mut Context<'_, SliderState>,
)
pub fn set_value( &mut self, value: impl Into<SliderValue>, _: &mut Window, cx: &mut Context<'_, SliderState>, )
Set the value of the slider.
Sourcepub fn value(&self) -> SliderValue
pub fn value(&self) -> SliderValue
Get the value of the slider.
Sourcepub fn step_value(&self) -> f32
pub fn step_value(&self) -> f32
Get the step value.
Trait Implementations§
impl EventEmitter<SliderEvent> for SliderState
Auto Trait Implementations§
impl Freeze for SliderState
impl RefUnwindSafe for SliderState
impl Send for SliderState
impl Sync for SliderState
impl Unpin for SliderState
impl UnsafeUnpin for SliderState
impl UnwindSafe for SliderState
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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