Struct SliderFace
pub struct SliderFace { /* private fields */ }Expand description
An immediate-mode slider face: everything Slider::paint needs to draw
one, with no widget instance and no CRDT binding.
A canvas app that owns its own hit-testing (a timeline inspector, a mixer
strip) cannot mount a retained Slider per control — it has no Taffy
node for them, and it needs a whole drag to land as one undo boundary. It
can still share the look, which is what this is for. Mirrors
Button::paint and
ToggleGroup::paint.
Implementations§
§impl SliderFace
impl SliderFace
pub fn new(rect: Rect, value: f64) -> SliderFace
pub fn new(rect: Rect, value: f64) -> SliderFace
A face over rect showing value (clamped to 0..=1).
pub fn hovered(self, v: bool) -> SliderFace
pub fn dragging(self, v: bool) -> SliderFace
pub fn focused(self, v: bool) -> SliderFace
pub fn disabled(self, v: bool) -> SliderFace
pub fn hit_rect(&self, theme: &Theme) -> Rect
pub fn hit_rect(&self, theme: &Theme) -> Rect
Where a pointer takes this slider: the track and the knob overhanging its ends, grown to the minimum pointer target.
pub fn overhang() -> f64
pub fn overhang() -> f64
How far the knob reaches past the track’s ends (its pressed radius): a host keeps this much room either side of a slider’s rect.
pub fn value_at(&self, point: Point) -> f64
pub fn value_at(&self, point: Point) -> f64
The share of the range (0..=1) under point, clamped at both ends.
pub fn track_rect(&self) -> Rect
pub fn track_rect(&self) -> Rect
The track rect this face paints, so a caller hit-tests the geometry it actually draws.
Trait Implementations§
§impl Clone for SliderFace
impl Clone for SliderFace
§fn clone(&self) -> SliderFace
fn clone(&self) -> SliderFace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SliderFace
impl Debug for SliderFace
impl Copy for SliderFace
Auto Trait Implementations§
impl Freeze for SliderFace
impl RefUnwindSafe for SliderFace
impl Send for SliderFace
impl Sync for SliderFace
impl Unpin for SliderFace
impl UnsafeUnpin for SliderFace
impl UnwindSafe for SliderFace
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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