From 0e324ec6929f6c34f6fc2c5d0b7b10c641bc06f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 13 Aug 2026 04:51:59 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(timeline):=20the=20subtitle=20?= =?UTF-8?q?strip=20answers=20the=20wheel=20like=20the=20lanes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strip under the tracks is drawn on the same bed, through the same Scale, and a cue is exactly what a hand aims at when it wants to see a line closer -- so it took the same wheel the ruler and the beds already take: ctrl magnifies about the pointer, a bare notch slides the view along. It ignored both until now, a dead surface in the middle of a live panel. Nothing occludes inside it -- the cue boxes and the playhead are plain paint -- so the bed's own listener is the whole of it. --- crates/app/src/ui/timeline.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/app/src/ui/timeline.rs b/crates/app/src/ui/timeline.rs index 145de07..3628ecc 100644 --- a/crates/app/src/ui/timeline.rs +++ b/crates/app/src/ui/timeline.rs @@ -43,7 +43,7 @@ impl Player { // Built from the same playhead pixel the lanes are, and before the // export takes `filled` over below: the strip is a picture of the // timeline, not of an export's progress. - let strip = self.subtitle_strip(filled); + let strip = self.subtitle_strip(filled, cx); let strip_h = subtitle_strip_h(strip.is_some()); let (hint, filled) = if let Some(export) = self.exporting() { let progress = export.progress(); @@ -590,7 +590,11 @@ impl Player { /// /// `None` with no track picked, so a timeline without subtitles is the panel /// it has always been. - pub(crate) fn subtitle_strip(&self, filled: f32) -> Option> { + pub(crate) fn subtitle_strip( + &self, + filled: f32, + cx: &mut Context, + ) -> Option> { let track = self.subtitle_track()?; let scale = self.scale; // The pick with its film on it, not the raw tag: two films' "eng" @@ -670,6 +674,15 @@ impl Player { .rounded(px(3.)) .bg(rgb(BG_TIMELINE())) .overflow_hidden() + // The same bed under the same [`Scale`] answers the same + // wheel ([`Player::timeline_wheel`]): ctrl zooms about + // the pointer, bare scrolls the view along. A hand that + // wants a cue closer aims at the cue, and a timeline + // surface that ignores the wheel is a dead one. + .on_scroll_wheel(cx.listener(|this, event: &ScrollWheelEvent, _, cx| { + cx.stop_propagation(); + this.timeline_wheel(event, cx); + })) .children(cues.into_iter().map(|(left, width)| { div() .absolute()