pub struct RangeSliderView<State: 'static> { /* private fields */ }Expand description
A declarative M3E range slider. See the module docs.
Implementations§
Source§impl<State: 'static> RangeSliderView<State>
impl<State: 'static> RangeSliderView<State>
Sourcepub fn range(self, min: f64, max: f64) -> Self
pub fn range(self, min: f64, max: f64) -> Self
Set the value bounds (M3ERangeSlider.min/max, defaulting to
0..=1). An inverted or empty range debug_assert!s and otherwise
degrades to a slider pinned at its minimum, as super::SliderView.
Sourcepub fn divisions(self, divisions: u32) -> Self
pub fn divisions(self, divisions: u32) -> Self
Step the slider into divisions equal intervals
(M3ERangeSlider.divisions). 0 is treated as continuous.
Sourcepub fn on_change_end<F: Fn(&mut State, SliderRange) + 'static>(
self,
on_change_end: F,
) -> Self
pub fn on_change_end<F: Fn(&mut State, SliderRange) + 'static>( self, on_change_end: F, ) -> Self
Fire on_change_end(state, values) when an interaction settles
(M3ERangeSlider.onChangeEnd). A cancelled drag never fires it.
Sourcepub fn labels(self, start: impl Into<String>, end: impl Into<String>) -> Self
pub fn labels(self, start: impl Into<String>, end: impl Into<String>) -> Self
Override both value-indicator labels (M3ERangeSlider.labels); the one
shown is the dragged thumb’s.
Sourcepub fn enabled(self, enabled: bool) -> Self
pub fn enabled(self, enabled: bool) -> Self
Gate interaction and switch to the disabled colour table
(M3ERangeSlider.enabled).
Sourcepub fn haptic(self, haptic: HapticSignal) -> Self
pub fn haptic(self, haptic: HapticSignal) -> Self
Opt into haptic feedback on value changes (M3ERangeSlider.haptic).
Sourcepub fn wavelength(self, wavelength: f64) -> Self
pub fn wavelength(self, wavelength: f64) -> Self
Length of one full wave cycle, in logical px
(M3ERangeSlider.wavelength). Inert unless the slider is wavy.
Sourcepub fn wave_speed(self, wave_speed: f64) -> Self
pub fn wave_speed(self, wave_speed: f64) -> Self
How fast the wave travels, in logical px per second
(M3ERangeSlider.waveSpeed). Inert unless the slider is wavy.
Sourcepub fn amplitude(self, amplitude: f64) -> Self
pub fn amplitude(self, amplitude: f64) -> Self
Fix the wave’s amplitude factor (M3ERangeSlider.amplitude). Inert
unless the slider is wavy; outranked by
Self::amplitude_for_progress.
Sourcepub fn amplitude_for_progress<F: Fn(f64) -> f64 + 'static>(
self,
curve: F,
) -> Self
pub fn amplitude_for_progress<F: Fn(f64) -> f64 + 'static>( self, curve: F, ) -> Self
Drive the wave’s amplitude factor from the span between the thumbs
(M3ERangeSlider.amplitudeForProgress). Inert unless wavy.
Sourcepub fn track_thickness(self, thickness: f64) -> Self
pub fn track_thickness(self, thickness: f64) -> Self
Thickness of both track segments, in logical px
(M3ERangeSlider.trackThickness).
Sourcepub fn corner_radius(self, radius: f64) -> Self
pub fn corner_radius(self, radius: f64) -> Self
Outer corner radius of both track segments, in logical px
(M3ERangeSlider.cornerRadius).
Sourcepub fn thumb_length(self, length: f64) -> Self
pub fn thumb_length(self, length: f64) -> Self
Length of each thumb along the cross axis, in logical px
(M3ERangeSlider.thumbLength).
Sourcepub fn dot_size(self, size: f64) -> Self
pub fn dot_size(self, size: f64) -> Self
Diameter of the stop/tick markers, in logical px
(M3ERangeSlider.dotSize).
Sourcepub fn dot_spacing(self, spacing: f64) -> Self
pub fn dot_spacing(self, spacing: f64) -> Self
Clear space between each track end and the outer edge of its marker, in
logical px (M3ERangeSlider.dotSpacing).
Trait Implementations§
Source§impl<State: 'static> View<State> for RangeSliderView<State>
impl<State: 'static> View<State> for RangeSliderView<State>
Source§type Element = RangeSliderWidget
type Element = RangeSliderWidget
Source§fn build(&self, _ctx: &mut BuildCtx<'_>) -> RangeSliderWidget
fn build(&self, _ctx: &mut BuildCtx<'_>) -> RangeSliderWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut RangeSliderWidget,
_ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut RangeSliderWidget, _ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl<State> !RefUnwindSafe for RangeSliderView<State>
impl<State> !Send for RangeSliderView<State>
impl<State> !Sync for RangeSliderView<State>
impl<State> !UnwindSafe for RangeSliderView<State>
impl<State> Freeze for RangeSliderView<State>where
Rc<dyn Fn(&mut State, SliderRange)>: Freeze,
Option<Rc<dyn Fn(&mut State, SliderRange)>>: Freeze,
impl<State> Unpin for RangeSliderView<State>where
Rc<dyn Fn(&mut State, SliderRange)>: Unpin,
Option<Rc<dyn Fn(&mut State, SliderRange)>>: Unpin,
impl<State> UnsafeUnpin for RangeSliderView<State>where
Rc<dyn Fn(&mut State, SliderRange)>: UnsafeUnpin,
Option<Rc<dyn Fn(&mut State, SliderRange)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.