Calendar · views on the clock keep moving

The week and day views read the clock once and handed that moment down
as given, which turned off the line's ticker: the line at now and the
lit day stood still. The owner's moment now goes down unchanged, and a
time grid, month view or year view on the clock keeps its own ticker,
so the line moves and today turns over at midnight, even on days that
are not today. A given moment holds them still.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-27 03:23:18 -04:00
1 parent 7e3f99f278
commit 57dd55320e
6 files changed
+106 -7

No files matched your search

+5 -2
View File
@@ -17,7 +17,7 @@ use crate::{
forms::{Drawing, OnValue, Stroke, pen},
layout::on_axis,
theme::{ActiveTheme, Radius, TextSize},
typography::format,
typography::{format, fresh},
};
/// Where a grid first opens: half past seven, or an hour and a half before now when that is later.
@@ -53,7 +53,7 @@ pub struct TimeGrid {
days: Vec<Date>,
events: Vec<Event>,
zone: Option<TimeZone>,
now: Option<Timestamp>,
pub(crate) now: Option<Timestamp>,
pub(crate) overlay: Option<TimezoneOverlay>,
pub(crate) on_create: Option<OnSpan>,
pub(crate) on_resize: Option<OnResize>,
@@ -361,6 +361,9 @@ impl TimeGrid {
impl RenderOnce for TimeGrid {
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement {
if self.now.is_none() {
fresh((self.id.clone(), "clock"), window, cx);
}
let zone = self
.zone
.clone()