The transport clock reads the preview while one is up
Browse files at this commit- fix
- the transport clock reads the preview while one is up
2 changed files +7 -11
crates/app/src/render.rsmodified+1 -6
| @@ -687,12 +687,7 @@ impl Render for Player { | |||
| 687 | .child(height_probe(self.notice_h.clone())), | 687 | .child(height_probe(self.notice_h.clone())), |
| 688 | ), | 688 | ), |
| 689 | ) | 689 | ) |
| 690 | - .child(self.transport_bar( | 690 | + .child(self.transport_bar(state, window.viewport_size(), cx)), |
| 691 | - position, | ||
| 692 | - state, | ||
| 693 | - window.viewport_size(), | ||
| 694 | - cx, | ||
| 695 | - )), | ||
| 696 | ) | 691 | ) |
| 697 | .child(divider(Split::Inspector, cx)) | 692 | .child(divider(Split::Inspector, cx)) |
| 698 | // The settings cards live in here rather than over the | 693 | // The settings cards live in here rather than over the |
crates/app/src/ui/toolbar.rsmodified+6 -5
| @@ -148,7 +148,6 @@ impl Player { | |||
| 148 | /// and the reason the edit toolbar below is nothing but edit tools. | 148 | /// and the reason the edit toolbar below is nothing but edit tools. |
| 149 | pub(crate) fn transport_bar( | 149 | pub(crate) fn transport_bar( |
| 150 | &self, | 150 | &self, |
| 151 | - position: f64, | ||
| 152 | state: Transport, | 151 | state: Transport, |
| 153 | viewport: Size<Pixels>, | 152 | viewport: Size<Pixels>, |
| 154 | cx: &mut Context<Self>, | 153 | cx: &mut Context<Self>, |
| @@ -209,12 +208,14 @@ impl Player { | |||
| 209 | .text_color(rgb(FG_PRIMARY())) | 208 | .text_color(rgb(FG_PRIMARY())) |
| 210 | .child(format!( | 209 | .child(format!( |
| 211 | "{} / {}", | 210 | "{} / {}", |
| 212 | - timecode(position, self.fps), | ||
| 213 | timecode( | 211 | timecode( |
| 214 | - self.session | 212 | + self.active_session().map_or(0., PlaybackSession::now), |
| 215 | - .as_ref() | 213 | + self.active_fps() |
| 214 | + ), | ||
| 215 | + timecode( | ||
| 216 | + self.active_session() | ||
| 216 | .map_or(0., PlaybackSession::timeline_duration), | 217 | .map_or(0., PlaybackSession::timeline_duration), |
| 217 | - self.fps | 218 | + self.active_fps() |
| 218 | ) | 219 | ) |
| 219 | )), | 220 | )), |
| 220 | ) | 221 | ) |