pub struct RangeSlider<'a> { /* private fields */ }Expand description
Two values on one bar, low <= high.
Implementations§
Source§impl<'a> RangeSlider<'a>
impl<'a> RangeSlider<'a>
Sourcepub fn new(
low: &'a mut f64,
high: &'a mut f64,
label: &str,
soft: RangeInclusive<f64>,
) -> Self
pub fn new( low: &'a mut f64, high: &'a mut f64, label: &str, soft: RangeInclusive<f64>, ) -> Self
A range slider spanning soft, which is also its hard range until
RangeSlider::hard widens it.
Sourcepub fn hard(self, hard: RangeInclusive<f64>) -> Self
pub fn hard(self, hard: RangeInclusive<f64>) -> Self
The range a typed value may reach (it always holds the soft range).
Sourcepub fn step(self, step: f64) -> Self
pub fn step(self, step: f64) -> Self
The step of arrows and the wheel; also sets the precision.
Sourcepub fn display_scale(self, scale: f64) -> Self
pub fn display_scale(self, scale: f64) -> Self
Shown and typed as value * scale (a fraction as a
percentage: 100).
Sourcepub fn logarithmic(self) -> Self
pub fn logarithmic(self) -> Self
A logarithmic bar (Curve::Logarithmic).
Sourcepub fn gradient(self, gradient: Gradient) -> Self
pub fn gradient(self, gradient: Gradient) -> Self
The track painted with a gradient (hue, temperature) along the bar.
Sourcepub fn state(self, state: FieldState) -> Self
pub fn state(self, state: FieldState) -> Self
The field’s state, drawn and announced as every field’s
(crate::field): a read-only slider takes the focus and
refuses changes, a disabled one is greyed and skipped by Tab,
with its reason as the tooltip.
Sourcepub fn on_change(self, hook: impl FnMut(&Change) -> Verdict + 'a) -> Self
pub fn on_change(self, hook: impl FnMut(&Change) -> Verdict + 'a) -> Self
Sees every change of either thumb before it is written
(Change::thumb says which; see the slider module’s “Hooks”).
Sourcepub fn show(self, ui: &mut Ui) -> SliderOutput
pub fn show(self, ui: &mut Ui) -> SliderOutput
Draws the range slider; says what changed.
Trait Implementations§
Source§impl<'a> Debug for RangeSlider<'a>
impl<'a> Debug for RangeSlider<'a>
Auto Trait Implementations§
impl<'a> Freeze for RangeSlider<'a>
impl<'a> !RefUnwindSafe for RangeSlider<'a>
impl<'a> !Send for RangeSlider<'a>
impl<'a> !Sync for RangeSlider<'a>
impl<'a> Unpin for RangeSlider<'a>
impl<'a> UnsafeUnpin for RangeSlider<'a>
impl<'a> !UnwindSafe for RangeSlider<'a>
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
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>
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>
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