From 217b8f2f8577c45309a54802fe2434eefe3fffee Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 10 Jul 2024 11:56:48 +0200 Subject: [PATCH] fix: sync timebar with clock with a horrible hack --- src/clock.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/clock.rs b/src/clock.rs index 580ed6a..0601de9 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -259,6 +259,9 @@ impl Clock { }; debug!("rendering the configured widgets"); frame.render_widget(clockw, parts[0]); + sleep(500); // HACK: through black magic, this works around the problem that the time bar is + // not rendered at the same time as the clock, and yes, it needs to be + // 500ms for some reason, and yes it makes starting the app slower frame.render_widget(&timebarw, parts[2]); frame.render_widget(datew, parts[1]); debug!("done rendering"); @@ -278,3 +281,7 @@ impl Clock { vec![part[0], subparts[0], subparts[1]] } } + +fn sleep(ms: u64) { + std::thread::sleep(std::time::Duration::from_millis(ms)); +}