pub struct EventCalendar { /* private fields */ }Expand description
A month with its events inside each day, for agendas and bookings. Use a
Calendar to pick a date and this to see what is on them.
From the keyboard the grid is one Tab stop: arrows move by day and week, Home and End to the ends of the week, Page Up and Page Down by month, and Enter or Space picks. A day’s name reads out what is on it.
use ravenrs_reactive::State;
use ravenrs_widgets::{Date, CalendarEvent, EventCalendar, Tone, Ui};
let today = Date::new(2026, 11, 15).unwrap();
let (month, day) = (State::new(today.first_of_month()), State::new(Some(today)));
let calendar = EventCalendar::new(month.binding(), day.binding())
.today(today)
.events([CalendarEvent::new(1, today, "Aluguel").tone(Tone::Warning)]);
let mut ui = Ui::new(calendar, ravenrs_style::Theme::raven_light());
ui.update();Implementations§
Source§impl EventCalendar
impl EventCalendar
Sourcepub fn new(
month: Binding<Date>,
selected: Binding<Option<Date>>,
) -> EventCalendar
pub fn new( month: Binding<Date>, selected: Binding<Option<Date>>, ) -> EventCalendar
month holds the month shown (any day of it), so the app can load its
events; selected holds the day picked.
Sourcepub fn events(
self,
events: impl IntoIterator<Item = CalendarEvent>,
) -> EventCalendar
pub fn events( self, events: impl IntoIterator<Item = CalendarEvent>, ) -> EventCalendar
The events; those outside the days shown are ignored.
Sourcepub fn today(self, today: Date) -> EventCalendar
pub fn today(self, today: Date) -> EventCalendar
Marks this day, and offers a button to come back to it.
Sourcepub fn events_per_day(self, count: usize) -> EventCalendar
pub fn events_per_day(self, count: usize) -> EventCalendar
How many events show in a day before the rest become a count (3 by default).
Sourcepub fn on_event(self, handler: impl Fn(u64) + 'static) -> EventCalendar
pub fn on_event(self, handler: impl Fn(u64) + 'static) -> EventCalendar
Called with an event’s id when it is clicked, after its day is picked.
Trait Implementations§
Source§impl Debug for EventCalendar
impl Debug for EventCalendar
Auto Trait Implementations§
impl !RefUnwindSafe for EventCalendar
impl !Send for EventCalendar
impl !Sync for EventCalendar
impl !UnwindSafe for EventCalendar
impl Freeze for EventCalendar
impl Unpin for EventCalendar
impl UnsafeUnpin for EventCalendar
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.