This commit is contained in:
Breadway 2026-05-19 12:31:26 +08:00
parent b8a3424834
commit 4a3604f78a
10 changed files with 371 additions and 107 deletions

View file

@ -11,8 +11,7 @@ pub fn spawn_ticker(sender: ComponentSender<App>) {
loop {
sender.input(AppInput::ClockTick);
// Sleep until the top of the next minute — display is HH:MM only.
let secs = gtk4::glib::DateTime::now_local()
.map_or(0, |dt| dt.second());
let secs = gtk4::glib::DateTime::now_local().map_or(0, |dt| dt.second());
let wait = (60 - secs.rem_euclid(60)) as u64;
tokio::time::sleep(std::time::Duration::from_secs(wait.max(1))).await;
}