pub struct Countdown {Show 14 fields
pub seconds: f64,
pub show_hours: bool,
pub show_minutes: bool,
pub show_seconds: bool,
pub digit_size: f32,
pub digit_color: String,
pub digit_background: String,
pub separator_color: String,
pub gap: f32,
pub border_radius: f32,
pub timing: TimingConfig,
pub style: CssStyle,
pub timeline: Vec<TimelineStep>,
pub stagger: Option<f32>,
}countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Expand description
#[serde(from = "CountdownRaw")]: box_builder.rs’s width formula for
this component (visible * 2*box_w + (visible-1)*gap) doesn’t include
the small inner gap (gap*0.3) paint() actually inserts within
each digit pair — only the gap between pairs (the separator). That
mismatch compounds with every extra group and is exactly what #127
measured (153×67 assigned vs. 187×68 painted). Since paint() draws
from self.digit_size/self.gap, not layout.width (same pattern as
switch/slider), the fix is to fold the exact formula paint()
uses into style.width here, so box_builder.rs’s if css.width.is_none() never gets a chance to apply its slightly-off one.
Fields§
§seconds: f64countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
show_hours: boolcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
show_minutes: boolcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
show_seconds: boolcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
digit_size: f32countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
digit_color: Stringcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
digit_background: Stringcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
separator_color: Stringcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
gap: f32countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
border_radius: f32countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
timing: TimingConfigcountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
style: CssStylecountdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
timeline: Vec<TimelineStep>countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
stagger: Option<f32>countdown is a frozen composition (issue #333). Compose digit tiles from a card + text per unit instead of the dedicated flip-clock — see crates/rustmotion/skills/rules/composition-recipes.md. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Trait Implementations§
Source§impl Animatable for Countdown
impl Animatable for Countdown
fn animation_effects(&self) -> &[AnimationEffect]
fn timeline_steps(&self) -> &[TimelineStep]
Source§impl<'de> Deserialize<'de> for Countdown
impl<'de> Deserialize<'de> for Countdown
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 Countdown
impl JsonSchema for Countdown
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 Countdown
impl Painter for Countdown
fn paint_content( &self, canvas: &Canvas, layout: &BoxLayout, _props: &AnimatedProperties, ctx: &PaintCtx, )
fn intrinsic_size( &self, _available: AvailableSize, _ctx: &MeasureCtx, ) -> Option<(f32, f32)>
Auto Trait Implementations§
impl Freeze for Countdown
impl RefUnwindSafe for Countdown
impl Send for Countdown
impl Sync for Countdown
impl Unpin for Countdown
impl UnsafeUnpin for Countdown
impl UnwindSafe for Countdown
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