FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust
Merge origin/main into #704 (gap and marker context menus side by side; contributors)
Brandon Thomase4f3cab5a094
diff --cc contributors/people.tomlindex 92d8f4b70,6e17daf05..e33a37927--- a/contributors/people.toml+++ b/contributors/people.toml@@@ -62,5 -62,7 +62,10 @@@ real_name = "Max Murphydisplay_name = "Max Murphy"sync_github_name = false+[people.ossini]+sync_github_name = true+++ [people.vangel76]+ real_name = "Valentin Klein"+ display_name = "Valentin Klein"+ sync_github_name = falsediff --cc crates/ui-egui/src/panels/timeline.rsindex ca77bbe7d,28b75008a..f5bfa7736--- a/crates/ui-egui/src/panels/timeline.rs+++ b/crates/ui-egui/src/panels/timeline.rs@@@ -386,17 -407,8 +409,18 @@@ pub fn show(app: &mut FilmcraftApp, ui}let p = painter.with_clip_rect(Rect::from_min_max(pos2(content.min.x, row.min.y), pos2(content.max.x, row.max.y)));let volume_line = r.kind == TrackKind::Audio && !r.lane;+ // the selected gap (#648, #668): a light block across the empty time, as in Premiere Pro+ if let Some(g) = app.session.state.gap_selection.filter(|g| g.track == r.track) {+ let x0 = layout.x_of(g.range.start).max(content.min.x - 1.0);+ let x1 = layout.x_of(g.range.end()).min(content.max.x + 1.0);+ if x1 > x0 {+ let gap = Rect::from_min_max(pos2(x0, r.rect.min.y + 1.0), pos2(x1, r.rect.max.y - 1.0));+ p.rect_filled(gap, 0.0, GAP_FILL);+ app.auto.add("timeline.gap", gap.intersect(content), "Selected gap");+ }+ }for it in &tr.items {+ let it = edited.get(&it.id).unwrap_or(it);let (start, dur, moved_track) = previews.get(&it.id).copied().unwrap_or((it.start, it.duration, None));if moved_track.is_some_and(|m| m != r.track) {continue;@@@ -2312,21 -2313,17 +2346,32 @@@ fn interact(app: &mut FilmcraftApp, uilet edit_point_menu_id = egui::Id::new("timeline.editPointMenu.target");// the clip right-clicked, remembered while its menu is open: Unlink leaves only it selectedlet menu_clip_id = egui::Id::new("timeline.clipMenu.clip");+ // right-clicking empty time between clips selects the gap and opens its menu (#648, #668)+ let gap_menu_id = egui::Id::new("timeline.gapMenu.open");+ if resp.secondary_clicked()+ && let Some(p) = resp.interact_pointer_pos()+ {+ let on_gap = match hit(seq, layout, p) {+ Hit::Empty { track } => app.session.execute("timeline.selectGap", json!({"track": track.0, "time": layout.tick_at(p.x).0})).is_ok(),+ _ => false,+ };+ ctx.data_mut(|d| d.insert_temp(gap_menu_id, on_gap));+ if on_gap {+ // not the edit point menu of a cut right-clicked before+ ctx.data_mut(|d| d.insert_temp::<Option<EditPointTarget>>(edit_point_menu_id, None));+ }+ }+ // on a marker of the ruler, the marker menu instead (right-clicking a marker selects it first)+ let marker_menu_id = egui::Id::new("timeline.markerMenu.open");+ if resp.secondary_clicked()+ && let Some(p) = resp.interact_pointer_pos()+ {+ let marker = marker_at(seq, layout, p);+ if let Some(m) = marker {+ app.session.set_playhead(m.max(Tick::ZERO));+ }+ ctx.data_mut(|d| d.insert_temp(marker_menu_id, marker.is_some()));+ }if resp.secondary_clicked()&& let Some(p) = resp.interact_pointer_pos()&& let Hit::Clip { clip, edge, track } = hit(seq, layout, p)