forge
Explore
Log in

Don't you dare go Hollow

A preview shows neither the timeline's captions nor its hints

Browse files at this commit

490cfd3072f02ae51b760110a6ccd905f339987cAhmet Kaan GümüşParent: a7406da
  • fix
    • a preview shows neither the timeline's captions nor its hints
Show full message
🐛 fix(app): a preview shows neither the timeline's captions nor its hints

The timeline's cue overlay would caption the wrong film over a preview
picture, and the drop-a-file hint keyed off the timeline session alone.
crates/app/src/render.rsmodified+1 -2
@@ -648,8 +648,7 @@ impl Render for Player {
648 // what it wants instead. The window648 // what it wants instead. The window
649 // is already the drop target.649 // is already the drop target.
650 .or_else(|| {650 .or_else(|| {
651- self.session651+ (self.active_session().is_none())
652- .is_none()
653 .then(|| empty_hint().into_any_element())652 .then(|| empty_hint().into_any_element())
654 }),653 }),
655 )654 )
crates/app/src/ui/preview.rsmodified+3 -0
@@ -120,6 +120,9 @@ impl Player {
120 let shown: Option<(Lane, Vec<engine::subtitle::Cue>)> = self120 let shown: Option<(Lane, Vec<engine::subtitle::Cue>)> = self
121 .active_sub_lane()121 .active_sub_lane()
122 .filter(|_| self.subs_on)122 .filter(|_| self.subs_on)
123+ // A preview is another file: the timeline's words over its
124+ // picture would caption the wrong film.
125+ .filter(|_| self.preview_session.is_none())
123 .and_then(|lane| {126 .and_then(|lane| {
124 let cues = self.session.as_ref()?.sub_lane_cues(lane);127 let cues = self.session.as_ref()?.sub_lane_cues(lane);
125 let now: Vec<_> = cues_at(&cues, at).into_iter().cloned().collect();128 let now: Vec<_> = cues_at(&cues, at).into_iter().cloned().collect();