diff --git a/crates/app/src/tests/view.rs b/crates/app/src/tests/view.rs index b08c1a3..3c771f0 100644 --- a/crates/app/src/tests/view.rs +++ b/crates/app/src/tests/view.rs @@ -968,9 +968,9 @@ fn escape_is_the_only_key_a_focused_surface_uses_to_leave_the_ring() { } /// [`ActionId::FocusPanels`] is what starts the ring in the first place -/// (`Player::act`'s `window.focus(&self.focus_dock)`) -- without a bound key -/// reaching it, `next_surface`/`is_focus_cycle_key` above are unreachable -/// dead code, exactly the defect this action closes. +/// (`Player::act`'s `self.focus_surface(Surface::Dock, ..)`) -- without a +/// bound key reaching it, `next_surface`/`is_focus_cycle_key` above are +/// unreachable dead code, exactly the defect this action closes. #[test] fn focus_panels_is_bound_and_lands_on_the_dock() { use keymap::{ActionId, Keymap}; diff --git a/crates/app/src/ui/bench_stance.rs b/crates/app/src/ui/bench_stance.rs index b53e58b..6d90124 100644 --- a/crates/app/src/ui/bench_stance.rs +++ b/crates/app/src/ui/bench_stance.rs @@ -288,7 +288,7 @@ fn clip_box( // the press so a set-drag has something to move; this is where the // collapse a plain click promises actually lands. .on_click(cx.listener(move |this, event: &ClickEvent, _, cx| { - if !event.modifiers().control { + if !press_modifiers(event).control { this.select((lane, idx), cx); } })) @@ -672,7 +672,7 @@ fn sub_box( // A plain click collapses a multi-pick to this one, exactly as a // clip's own box does -- see the comment there. .on_click(cx.listener(move |this, event: &ClickEvent, _, cx| { - if !event.modifiers().control { + if !press_modifiers(event).control { this.select((lane, idx), cx); } })) diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index db7bc00..12ab1dd 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -1077,13 +1077,6 @@ fn sources_tab( }) } -/// The Clip tab: the four verbs DESIGN §5 names, as ghosts, over whichever -/// param-row card they open -- [`Player::eq_card`], [`Player::color_card`], -/// [`Player::transform_card`], [`Player::speed_card`] verbatim, the same -/// param-row rendering `inspector.rs`'s selection section already opens -/// these onto. Drag-while-playing and every other gesture on a row is -/// whatever that card already does; nothing about the gesture is reimplemented -/// here. /// The transition duration row, in the darkroom's own idiom: the darkroom is /// the default surface (`main.rs`'s `OLD_GUI` gate), so a row that only ever /// drew in the legacy inspector (`ui::inspector::transition_duration_row`) @@ -1099,7 +1092,7 @@ fn transition_row(player: &Player, cx: &mut Context) -> Option| { + let step = |id: &'static str, label: &'static str, glyph: &'static str, by: i32, cx: &mut Context| { div() .id(id) .flex() @@ -1111,7 +1104,7 @@ fn transition_row(player: &Player, cx: &mut Context) -> Option) -> Option, ) { + if !self.darkroom { + return; + } if let Some(src_active) = surface_wants_src_active(surface) { self.dock_src_active = src_active; crate::ui::dock_stance::save(src_active); diff --git a/crates/app/src/ui/timeline.rs b/crates/app/src/ui/timeline.rs index b5c0de2..bce841a 100644 --- a/crates/app/src/ui/timeline.rs +++ b/crates/app/src/ui/timeline.rs @@ -1390,7 +1390,7 @@ impl Player { // starts, so this only fires on a press-release // with no drag between. .on_click(cx.listener(move |this, event: &ClickEvent, _, cx| { - if !event.modifiers().control { + if !press_modifiers(event).control { this.select((lane, i), cx); } })) @@ -1775,7 +1775,7 @@ impl Player { // A plain click collapses a multi-pick to this one // caption, exactly as a clip's own box does above. .on_click(cx.listener(move |this, event: &ClickEvent, _, cx| { - if !event.modifiers().control { + if !press_modifiers(event).control { this.select((lane, i), cx); } })) diff --git a/crates/app/src/ui/widgets.rs b/crates/app/src/ui/widgets.rs index 44c77fc..e5f16f8 100644 --- a/crates/app/src/ui/widgets.rs +++ b/crates/app/src/ui/widgets.rs @@ -9,6 +9,18 @@ pub(crate) fn waveform(peaks: Arc>, from: f64, to: f64) -> impl waveform_ink(peaks, from, to, FG_SECONDARY()) } +/// `ClickEvent::modifiers()` answers the mouse-*up* modifiers (gpui-0.2.2 +/// `interactive.rs`), so releasing ctrl before the button lands undoes a +/// ctrl-held toggle decided on mouse-down. This reads the *press* modifiers +/// instead -- the ones a ctrl-click decision (multi-pick, no collapse) was +/// actually made under. +pub(crate) fn press_modifiers(event: &ClickEvent) -> gpui::Modifiers { + match event { + ClickEvent::Mouse(m) => m.down.modifiers, + ClickEvent::Keyboard(_) => gpui::Modifiers::default(), + } +} + /// As [`waveform`], but in a caller-picked ink rather than the fixed /// secondary foreground -- the darkroom bench's own audio clips draw their /// envelope in the source's ink (DESIGN §5), which the legacy timeline never