forge
Explore
Log in

Don't you dare go Hollow

Captions get their per-cue blocks back

Browse files at this commit

c4ece9fc4ae59028e009953f24fbddbdfe1406b2Ahmet Kaan GümüşParent: dc4ce87
  • fix
    • captions get their per-cue blocks back
Show full message
🐛 fix(timeline): captions get their per-cue blocks back

The 4px cue band at the bottom of a caption box was too subtle to see
where a sentence starts and ends. Each cue is now its own full-height
rounded block (CLIP_TEXT) over a letterbox-dark box (BG_PANEL), the
original subtitle_strip look, with visible gaps between cues. The
per-box name label is dropped since it fought the blocks; the tooltip
still carries the words. Drag, trim, selection border and eye toggle
are unchanged.
crates/app/src/ui/timeline.rsmodified+20 -25
@@ -1579,13 +1579,14 @@ impl Player {
15791579 } else {
15801580 FG_SECONDARY()
15811581 }))
1582- // The captions' own colour, dimmed on a lane whose
1583- // eye is shut: what is not being drawn over the
1584- // picture is still on the lane, and says so. Marked,
1585- // it takes the selection's colours instead, the same
1582+ // A letterbox ground rather than the captions' own
1583+ // colour: the box itself is where a sentence starts
1584+ // and ends on the bed, and that is drawn by the cue
1585+ // blocks below, not by the box's own fill. Marked,
1586+ // it still takes the selection's colour, the same
15861587 // pair a marked clip takes -- what Delete will act
15871588 // on has one look on this bed and not two.
1588- .bg(rgb(if on { BG_SELECTED() } else { CLIP_TEXT() }))
1589+ .bg(rgb(if on { BG_SELECTED() } else { BG_PANEL() }))
15891590 .when(!shown, |d| d.opacity(0.55))
15901591 .cursor_pointer()
15911592 .hover(|s| s.border_color(rgb(ACCENT_PRIMARY())))
@@ -1712,20 +1713,12 @@ impl Player {
17121713 zone
17131714 }),
17141715 )
1715- .when_some(label.filter(|_| show_label(vis_w)), |d, label| {
1716- d.child(
1717- div()
1718- .absolute()
1719- .top_0()
1720- .left(px(vis_x))
1721- .w(px(vis_w))
1722- .h(px(LABEL_H))
1723- .px(px(4.))
1724- .truncate()
1725- .text_size(px(10.))
1726- .child(label),
1727- )
1728- })
1716+ // No name drawn on the box itself: the cue blocks
1717+ // now fill its full height, and a label sitting
1718+ // over them fights the very thing this box exists
1719+ // to show. The tooltip still carries the words
1720+ // (`sub_tip`), and the ghost while dragging still
1721+ // names the track (`ghost`, above).
17291722 // The way back off the lane is the way every other
17301723 // box takes: the Delete stroke on the marked caption
17311724 // and the Delete row of its own menu
@@ -1736,20 +1729,22 @@ impl Player {
17361729 // caption did not have.
17371730 }))
17381731 // ...and where the words actually are inside those boxes:
1739- // the cues this lane shows on *this* timeline, in a band
1740- // along the bottom of the row. A placement is a window of a
1732+ // the cues this lane shows on *this* timeline, each its own
1733+ // full-height block over the letterbox ground, inset a
1734+ // pixel so the gap between two sentences is visible even
1735+ // when they sit back to back. A placement is a window of a
17411736 // track, so a box is not full of speech -- and a lane whose
17421737 // marks are all in its first half is a caption dragged too
1743- // far, which is exactly what this band shows.
1738+ // far, which is exactly what this shows.
17441739 .children(cues.into_iter().map(|(left, width)| {
17451740 div()
17461741 .absolute()
1747- .bottom_0()
1748- .h(px(4.))
1742+ .top(px(1.))
1743+ .bottom(px(1.))
17491744 .left(px(left))
17501745 .w(px(width))
17511746 .rounded(px(2.))
1752- .bg(rgb(BG_SELECTED()))
1747+ .bg(rgb(CLIP_TEXT()))
17531748 }))
17541749 // What the silence card found, over the clips it found them
17551750 // in and over the waveform band that shows why: on the lane