pub struct Slider {Show 15 fields
pub value: f64,
pub animate_to: Option<f64>,
pub animate_at: Option<f64>,
pub animation_duration: f64,
pub width: f32,
pub height: f32,
pub track_color: String,
pub fill_color: String,
pub thumb_size: f32,
pub thumb_color: String,
pub show_value: bool,
pub timing: TimingConfig,
pub style: CssStyle,
pub timeline: Vec<TimelineStep>,
pub stagger: Option<f32>,
}Expand description
#[serde(from = "SliderRaw")]: like switch/countdown, paint()
draws from this component’s own fields, never layout.width/
layout.height — box_builder.rs’s css.width/height = Px(c.width / c.height) only budgets for the thin track, not the round thumb
(thumb_size, typically bigger than the track) that can sit centered
on either end, nor the show_value “N%” label that floats above it
(#127 measured 396×7 assigned vs. 417×31 painted). The raw shadow
struct computes the true bounding box once — same font metrics
paint() uses — and folds it into style.width/style.height before
box_builder.rs ever runs, without editing that file. paint() itself
is updated below to offset its drawing into that box instead of
treating local (0,0) as the thumb’s top-left.
Fields§
§value: f64§animate_to: Option<f64>§animate_at: Option<f64>§animation_duration: f64§width: f32§height: f32§track_color: String§fill_color: String§thumb_size: f32§thumb_color: String§show_value: bool§timing: TimingConfig§style: CssStyle§timeline: Vec<TimelineStep>§stagger: Option<f32>Trait Implementations§
Source§impl Animatable for Slider
impl Animatable for Slider
fn animation_effects(&self) -> &[AnimationEffect]
Source§fn timeline_steps(&self) -> &[TimelineStep]
fn timeline_steps(&self) -> &[TimelineStep]
timeline field): each step’s animations are
resolved with delay += step.at. Empty by default.Source§impl<'de> Deserialize<'de> for Slider
impl<'de> Deserialize<'de> for Slider
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Slider
impl JsonSchema for Slider
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Painter for Slider
impl Painter for Slider
Source§fn paint_content(
&self,
canvas: &Canvas,
layout: &BoxLayout,
_props: &AnimatedProperties,
ctx: &PaintCtx,
)
fn paint_content( &self, canvas: &Canvas, layout: &BoxLayout, _props: &AnimatedProperties, ctx: &PaintCtx, )
overflow: hidden was set. Generic decorations (bg, border,
shadow) are already painted by the engine. Read moreSource§fn intrinsic_size(
&self,
_available: AvailableSize,
_ctx: &MeasureCtx,
) -> Option<(f32, f32)>
fn intrinsic_size( &self, _available: AvailableSize, _ctx: &MeasureCtx, ) -> Option<(f32, f32)>
text, image,
codeblock. Return None to let taffy compute the size from the
CSS style alone. available mirrors taffy’s AvailableSpace.Auto Trait Implementations§
impl Freeze for Slider
impl RefUnwindSafe for Slider
impl Send for Slider
impl Sync for Slider
impl Unpin for Slider
impl UnsafeUnpin for Slider
impl UnwindSafe for Slider
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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