fix: sync timebar with clock with a horrible hack
cargo devel CI / cargo CI (push) Successful in 1m25s Details

This commit is contained in:
Christoph J. Scherr 2024-07-10 11:56:48 +02:00
parent 4da80e8f0f
commit 217b8f2f85
1 changed files with 7 additions and 0 deletions

View File

@ -259,6 +259,9 @@ impl Clock {
}; };
debug!("rendering the configured widgets"); debug!("rendering the configured widgets");
frame.render_widget(clockw, parts[0]); 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(&timebarw, parts[2]);
frame.render_widget(datew, parts[1]); frame.render_widget(datew, parts[1]);
debug!("done rendering"); debug!("done rendering");
@ -278,3 +281,7 @@ impl Clock {
vec![part[0], subparts[0], subparts[1]] vec![part[0], subparts[0], subparts[1]]
} }
} }
fn sleep(ms: u64) {
std::thread::sleep(std::time::Duration::from_millis(ms));
}