Due to "Recursion detected" bugs in slint, we need to calculate the layout of the timeline in Rust. This is ugly, but works.