Skip to main content

CalendarDayConfig

Struct CalendarDayConfig 

Source
pub struct CalendarDayConfig {
    pub label: String,
    pub fill: Signal<CalendarDayFill>,
    pub is_today: bool,
    pub is_out_of_month: bool,
    pub is_disabled: bool,
    pub is_focused_cell: Signal<bool>,
    pub cell_size: f32,
}
Expand description

Per-day cell input to CalendarStyle::make_day_cell.

The static fields (is_today, is_out_of_month, is_disabled) don’t change within a build session — the calendar binds visible_month at Rebuild level, so cells are regenerated when the visible month moves. Everything reactive (selection fill, the roving-focus ring) flows through Signals so per-click navigation doesn’t tear down the 42-cell subtree.

label is passed as a plain string rather than a pre-built widget id so the recipe owns the label’s text-colour binding — the label colour depends on the reactive fill state (Selected → OnAccent, otherwise Primary) which is paint-time data, not widget-construction data.

Fields§

§label: String

Day-number string (e.g. "15"). The recipe builds the TextWidget itself so it can drive the text colour from fill (Selected → OnAccent, otherwise Primary). Accepts either a plain String or a LocalizedString from tr!(…)LocalizedString implements From<…> for String, so .into() covers both shapes. Day numbers are pure digits in IntUI and pass through as untranslated literals, but a custom recipe is free to localize.

§fill: Signal<CalendarDayFill>

Reactive selection-derived fill.

§is_today: bool

true when this cell’s date equals the local “today”. The recipe paints the today ring on top of any selection fill.

§is_out_of_month: bool

true when this cell’s date falls outside the currently-visible month (leading / trailing 7-day padding). The recipe usually dims the label.

§is_disabled: bool

true when this cell is unselectable (filter, min/max, etc.). The recipe forces a disabled appearance regardless of fill.

§is_focused_cell: Signal<bool>

true only while the parent calendar holds keyboard focus AND this cell’s date is the currently-focused one (roving focus).

§cell_size: f32

Cell edge length — the recipe sizes its rect to this.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.