diff --git a/crates/app/src/audio_cards.rs b/crates/app/src/audio_cards.rs index 534abff..08189d4 100644 --- a/crates/app/src/audio_cards.rs +++ b/crates/app/src/audio_cards.rs @@ -119,6 +119,21 @@ pub(crate) const EQ_FREQ_HIGH: f32 = 20_000.; /// and short enough that the card still fits a 360 px window. pub(crate) const EQ_GRAPH_H: f32 = 132.; +/// The curve box maximized: 1 dB and a semitone-ish band of frequency both +/// read as more pixels than the docked floor spends on them -- the same +/// curve, the same ±12 dB axis and the same 20 Hz-20 kHz sweep, just spread +/// over more of the vertical resolution a maximized card borrows from the +/// bench/ledger rows below the picture ([`crate::ui::stance::below_picture_floor`]). +pub(crate) const EQ_GRAPH_MAX_H: f32 = 320.; + +/// The graph's own height for the card's current size: the docked floor, or +/// the maximized card's own taller box -- never a CSS scale of the same +/// pixels, an actually taller curve with more room per decibel and per +/// decade. +pub(crate) fn eq_graph_h(maximized: bool) -> f32 { + if maximized { EQ_GRAPH_MAX_H } else { EQ_GRAPH_H } +} + /// How wide the equalizer card is allowed to get. It is the one card that is a /// *graph*: every pixel across is frequency resolution, and at the 320 px the /// other cards use, a third of an octave was a couple of pixels. Past this the diff --git a/crates/app/src/library_meta.rs b/crates/app/src/library_meta.rs index 581b9dd..4ffa497 100644 --- a/crates/app/src/library_meta.rs +++ b/crates/app/src/library_meta.rs @@ -320,8 +320,28 @@ pub(crate) fn unusable(info: &StreamInfo, timeline_audio: Option<(u32, u16)>) -> /// thousand hertz on 320 px spends four pixels on the octave below middle C -- /// so it takes the room a big window has and stays inside a small one. Floored /// at the other cards' width, which is the last size the rows still read at. -pub(crate) fn eq_card_w(window_w: f32) -> f32 { - (window_w - EQ_W_MARGIN).clamp(KEYS_W, EQ_W_MAX) +pub(crate) fn eq_card_w(window_w: f32, maximized: bool) -> f32 { + let raw = window_w - EQ_W_MARGIN; + if maximized { + // Maximized drops the [`EQ_W_MAX`] ceiling: every pixel across is + // frequency resolution (the doc comment above), and a maximized card + // is asking for exactly the room a big window has to give it. + raw.max(KEYS_W) + } else { + raw.clamp(KEYS_W, EQ_W_MAX) + } +} + +/// How wide a non-EQ param card is drawn: its usual fixed width, or (when +/// maximized) all of the window bar the same margin the EQ card gives +/// itself -- never narrower than its own floor, so a small window's +/// maximize is a no-op rather than a shrink. +pub(crate) fn card_max_w(base_w: f32, maximized: bool, window_w: f32) -> f32 { + if maximized { + (window_w - EQ_W_MARGIN).max(base_w) + } else { + base_w + } } /// What the media list is given of the window. A share of it, so a narrow diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 2feb555..0b1536c 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -571,6 +571,13 @@ struct Player { /// the card is modal: while it is up nothing else can move an index, and /// the one edit it makes (`set_eq`) moves none. eq_open: Option<(Lane, usize)>, + /// Whichever of the seven param cards is open, filling the room in place + /// of the bench/ledger rows instead of its usual capped, floating size + /// (`Player::toggle_maximize`). One flag, not one per card, because only + /// one of them is ever open at a time (`close_card`'s own rule) and it + /// outlives any one card's close/reopen, persisted like the dock tab pick + /// (`ui::dock_stance::load_maximized`/`save_maximized`). + card_maximized: bool, /// The curve the card is showing, which is the clip's own or the flat /// five-band default. Edited live and written at the clip once per gesture /// ([`Player::commit_eq`]): the project's equalizer table is append-only, so @@ -954,6 +961,7 @@ fn main() { export_refusals_inline: false, export_advanced_open: false, eq_open: None, + card_maximized: ui::dock_stance::load_maximized(), // Replaced by the clip's own curve the moment the card // opens; nothing reads it before that. eq_params: EqParams::default(), diff --git a/crates/app/src/player/cards.rs b/crates/app/src/player/cards.rs index 0e82abd..a006626 100644 --- a/crates/app/src/player/cards.rs +++ b/crates/app/src/player/cards.rs @@ -1283,6 +1283,17 @@ impl Player { self.subtitle_style_open = false; } + /// The one switch every param card's expand affordance and its `m` + /// chord both flip (`dark_card_head`, [`Player::param_card_key`]): + /// whichever card is open trades its usual capped, floating size for the + /// bench/ledger rows' own room, in place -- layout only, no value on the + /// card changes. Persisted like the dock tab pick so a maximized EQ is + /// still maximized after the room closes and reopens. + pub(crate) fn toggle_maximize(&mut self) { + self.card_maximized = !self.card_maximized; + ui::dock_stance::save_maximized(self.card_maximized); + } + /// Opens the equalizer on the selected clip. Audio only, and it says so /// rather than opening a card of bands that would reach nothing: a video /// clip carries no sound of its own here (the sound is the audio lane's), @@ -1459,8 +1470,32 @@ impl Player { /// and ate the key, the caller's cue to `cx.notify()` and stop exactly /// where each of these branches used to `return` inline. pub(crate) fn param_card_key(&mut self, key: &str, shift: bool, cx: &mut Context) -> bool { + // The one chord every param card answers to, wherever the pointer + // toggle sits in `dark_card_head` -- mouse and key reach the same + // switch (DESIGN's repeated "some options are only reachable via + // keyboard shortcut" complaint). Checked once, ahead of the seven + // card-local branches below, because it means the same thing in all + // of them: none of the seven uses bare "m" for anything else. + if key == "m" + && (self.eq_open.is_some() + || self.color_open.is_some() + || self.transform_open.is_some() + || self.speed_open.is_some() + || self.silence_open.is_some() + || self.mix_open + || self.subtitle_style_open) + { + self.toggle_maximize(); + return true; + } if self.eq_open.is_some() { if key == ESCAPE { + // Maximized comes off before the card does -- "esc always + // retreats" one step at a time (DESIGN.md:146). + if self.card_maximized { + self.toggle_maximize(); + return true; + } // Nothing to undo: every change is already at the clip, and // undo is undo's own key. self.eq_open = None; @@ -1516,6 +1551,7 @@ impl Player { // menu still lists them. if self.color_open.is_some() { match color_key(key) { + Some(ColorKey::Close) if self.card_maximized => self.toggle_maximize(), Some(ColorKey::Close) => { self.color_open = None; self.color_dragging = false; @@ -1537,7 +1573,9 @@ impl Player { // the keys menu still lists them). if self.transform_open.is_some() { let n = TRANSFORM_BANDS.len(); - if key == ESCAPE { + if key == ESCAPE && self.card_maximized { + self.toggle_maximize(); + } else if key == ESCAPE { self.transform_open = None; self.transform_dragging = false; } else if key == "down" { @@ -1559,6 +1597,7 @@ impl Player { // menu still lists them). if self.speed_open.is_some() { match color_key(key) { + Some(ColorKey::Close) if self.card_maximized => self.toggle_maximize(), Some(ColorKey::Close) => { self.speed_open = None; self.speed_dragging = false; @@ -1579,7 +1618,9 @@ impl Player { // the keys menu (keymap.rs `FIXED`), because a key that cuts forty // places at once is not a secret. if self.silence_open.is_some() { - if key == ESCAPE { + if key == ESCAPE && self.card_maximized { + self.toggle_maximize(); + } else if key == ESCAPE { // Nothing to undo: a preview is not an edit. self.close_silence(); } else if key == "down" { @@ -1602,7 +1643,9 @@ impl Player { // it, held or pressed. Card-local like the four above it. if self.mix_open { let rows = self.mix_lanes().len() + MIX_MASTER_ROWS; - if key == ESCAPE { + if key == ESCAPE && self.card_maximized { + self.toggle_maximize(); + } else if key == ESCAPE { self.mix_open = false; } else if key == "down" { self.mix_field = (self.mix_field + 1) % rows; @@ -1625,7 +1668,9 @@ impl Player { // Row 0 is the size stepper, row 1 the platform default, and // every row after it a family in `subtitle_fonts`. let rows = 2 + self.subtitle_fonts.len(); - if key == ESCAPE { + if key == ESCAPE && self.card_maximized { + self.toggle_maximize(); + } else if key == ESCAPE { self.subtitle_style_open = false; } else if key == "down" { self.subtitle_style_field = (self.subtitle_style_field + 1) % rows; diff --git a/crates/app/src/ui/cards.rs b/crates/app/src/ui/cards.rs index 88d552e..2cc66ac 100644 --- a/crates/app/src/ui/cards.rs +++ b/crates/app/src/ui/cards.rs @@ -51,13 +51,56 @@ fn dark_row_value(text: impl Into) -> Div { /// directly); now it rides a `?` glyph beside the head and only shows on /// hover, the same hover-only convention [`dock_stance::ghost_verb`] /// already uses for a verb's own description. -fn dark_card_head(verb: &str, meta: Option, help: Option) -> Div { +/// `maximize` is `None` for the one card this head builds that is not one of +/// the seven param cards (the export progress sheet): everything else passes +/// `Some(self.card_maximized)` and gets the affordance this session's +/// complaint asked for -- worn on the head (DESIGN.md:91's "chord is worn"), +/// so it never was a keyboard-only option (the repeated "some options are +/// only reachable via keyboard shortcut" complaint). A double-click anywhere +/// on the head does the same thing the glyph's click and the `m` chord do +/// ([`Player::toggle_maximize`]) -- mouse and key reach the same switch. +fn dark_card_head( + verb: &str, + meta: Option, + help: Option, + maximize: Option, + cx: &mut Context, +) -> impl IntoElement { div() + .id("card-head") .flex_none() .px(px(6.)) .flex() .items_baseline() .gap(px(6.)) + .when(maximize.is_some(), |d| { + d.on_mouse_down( + MouseButton::Left, + cx.listener(|this, event: &MouseDownEvent, _, cx| { + if event.click_count >= 2 { + this.toggle_maximize(); + cx.notify(); + } + }), + ) + }) + .children(maximize.map(|max| { + div() + .id("card-head-maximize") + .flex_none() + .cursor_pointer() + .type_style(type_scale::mono(type_scale::CHORD_METADATA_MAX_PX, gpui::FontWeight::MEDIUM)) + .text_color(rgb(INK3())) + .on_click(cx.listener(|this, _: &ClickEvent, _, cx| { + this.toggle_maximize(); + cx.notify(); + })) + .tooltip(move |_, cx| { + cx.new(|_| OverlayTip(if max { "m -- back to the room".into() } else { "m -- fills the room".into() })) + .into() + }) + .child(if max { "▣ m" } else { "⤢ m" }) + })) .child( div() .type_style(type_scale::head()) @@ -1094,7 +1137,7 @@ impl Player { .rounded(px(6.)) .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) - .when(dark, |d| d.child(dark_card_head("Exporting", None, None))) + .when(dark, |d| d.child(dark_card_head("Exporting", None, None, None, cx))) .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting"))) // The bar itself: the same number as the percentage // below it, and it only ever moves forward -- the @@ -1335,7 +1378,7 @@ impl Player { .id("eq-graph") .relative() .flex_none() - .h(px(EQ_GRAPH_H)) + .h(px(eq_graph_h(dark && self.card_maximized))) .rounded(px(3.)) .bg(rgb(if dark { DARK_HAIRLINE() } else { BG_HOVER_DIM() })) .cursor_pointer() @@ -1468,6 +1511,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) // Click away closes it, as on every card here. .on_mouse_down( MouseButton::Left, @@ -1486,7 +1530,7 @@ impl Player { // of the window. The two cards beside it are built this // way for the same reason. .w_full() - .max_w(px(eq_card_w(f32::from(viewport.width)))) + .max_w(px(eq_card_w(f32::from(viewport.width), self.card_maximized))) // And a cap the other way, for the same reason the width // has one: the card is docked in a column now, and at the // 360 px floor it is taller than that column -- its title @@ -1519,7 +1563,9 @@ impl Player { d.child(dark_card_head( "Equalizer", Some(format!("{} clip {}", lane.label(), idx + 1).into()), - Some("drag a handle, or a digit picks a band — ←→ moves it, ↑↓ its gain, shift+←→ its width; a adds, x removes, f flattens it, r all, s spectrum; a click away or esc closes".into()), + Some("drag a handle, or a digit picks a band — ←→ moves it, ↑↓ its gain, shift+←→ its width; a adds, x removes, f flattens it, r all, s spectrum, m fills the room; a click away or esc closes".into()), + Some(self.card_maximized), + cx, )) }) .when(!dark, |d| { @@ -1871,7 +1917,7 @@ impl Player { /// the decoder is grading with, never a copy that could drift from it. The /// graph above them is counted off the frame that came *back* through that /// grade ([`histogram`]), so pulling exposure tilts it while the hand moves. - pub(crate) fn color_card(&self, cx: &mut Context) -> Option { + pub(crate) fn color_card(&self, viewport: Size, cx: &mut Context) -> Option { let (lane, idx) = self.color_open?; let params = self.color_params(); let dark = self.darkroom; @@ -1970,6 +2016,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) // Click away closes it, as on every card here. .on_mouse_down( MouseButton::Left, @@ -1982,7 +2029,7 @@ impl Player { .child( div() .w_full() - .max_w(px(COLOR_W)) + .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .flex() .flex_col() @@ -1992,7 +2039,7 @@ impl Player { .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) .when(dark, |d| { - d.child(dark_card_head("Colour", Some(head_meta.clone()), Some(help_text.into()))) + d.child(dark_card_head("Colour", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)) }) .when(!dark, |d| { d.child(div().flex_none().px(px(6.)).child(format!( @@ -2062,7 +2109,7 @@ impl Player { /// The transform card: [`color_card`](Self::color_card)'s own shape, one /// row per [`TRANSFORM_BANDS`] entry instead of four, and no histogram -- /// there is nothing here a graded frame would tilt. - pub(crate) fn transform_card(&self, cx: &mut Context) -> Option { + pub(crate) fn transform_card(&self, viewport: Size, cx: &mut Context) -> Option { let (lane, idx) = self.transform_open?; let params = self.transform_params(); let dark = self.darkroom; @@ -2152,6 +2199,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) .on_mouse_down( MouseButton::Left, cx.listener(|this, _: &MouseDownEvent, _, cx| { @@ -2163,7 +2211,7 @@ impl Player { .child( div() .w_full() - .max_w(px(TRANSFORM_W)) + .max_w(px(card_max_w(TRANSFORM_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .flex() .flex_col() @@ -2173,7 +2221,7 @@ impl Player { .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) .when(dark, |d| { - d.child(dark_card_head("Transform", Some(head_meta.clone()), Some(help_text.into()))) + d.child(dark_card_head("Transform", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)) }) .when(!dark, |d| { d.child(div().flex_none().px(px(6.)).child(format!( @@ -2236,7 +2284,7 @@ impl Player { /// /// Honest about what it does: the sound is *resampled*, so the pitch goes up /// with the rate, which is what the tape in the title means. - pub(crate) fn speed_card(&self, cx: &mut Context) -> Option { + pub(crate) fn speed_card(&self, viewport: Size, cx: &mut Context) -> Option { let (lane, idx) = self.speed_open?; let speed = self.card_speed(); let session = self.session.as_ref()?; @@ -2290,6 +2338,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) // Click away closes it, as on every card here. .on_mouse_down( MouseButton::Left, @@ -2302,7 +2351,7 @@ impl Player { .child( div() .w_full() - .max_w(px(COLOR_W)) + .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .flex() .flex_col() @@ -2312,7 +2361,7 @@ impl Player { .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) .when(dark, |d| { - d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()), Some(help_text.into()))) + d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)) }) .when(!dark, |d| { d.child(div().flex_none().px(px(6.)).child(format!( @@ -2401,7 +2450,7 @@ impl Player { /// move it too. The rows scroll rather than the card growing past the /// window -- a timeline may hold more tracks than a 360 px window has room /// for faders. - pub(crate) fn mix_card(&self, cx: &mut Context) -> Option { + pub(crate) fn mix_card(&self, viewport: Size, cx: &mut Context) -> Option { if !self.mix_open { return None; } @@ -2523,6 +2572,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) // Click away closes it, as on every card here. .on_mouse_down( MouseButton::Left, @@ -2535,7 +2585,7 @@ impl Player { .child( div() .w_full() - .max_w(px(COLOR_W)) + .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .max_h(px(360. - 24.)) .flex() @@ -2545,7 +2595,7 @@ impl Player { .rounded(px(6.)) .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) - .when(dark, |d| d.child(dark_card_head("Mix", None, Some(help_text.into())))) + .when(dark, |d| d.child(dark_card_head("Mix", None, Some(help_text.into()), Some(self.card_maximized), cx))) .when(!dark, |d| { d.child( div() @@ -2598,7 +2648,7 @@ impl Player { /// card's shape for the same reason: app-global, kept in a file beside /// the theme, and drawn straight off `self.sub_text` / `self.sub_family` /// so a change is on the cue underneath before the card is closed. - pub(crate) fn subtitle_style_card(&self, cx: &mut Context) -> Option { + pub(crate) fn subtitle_style_card(&self, viewport: Size, cx: &mut Context) -> Option { if !self.subtitle_style_open { return None; } @@ -2727,6 +2777,7 @@ impl Player { .justify_center() .items_center() .bg(rgba(SCRIM())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) .on_mouse_down( MouseButton::Left, cx.listener(|this, _: &MouseDownEvent, _, cx| { @@ -2738,7 +2789,7 @@ impl Player { .child( div() .w_full() - .max_w(px(COLOR_W)) + .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .max_h(px(360. - 24.)) .flex() @@ -2749,7 +2800,7 @@ impl Player { .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) .when(dark, |d| { - d.child(dark_card_head("Subtitle style", None, Some(help_text.into()))) + d.child(dark_card_head("Subtitle style", None, Some(help_text.into()), Some(self.card_maximized), cx)) }) .when(!dark, |d| { d.child( @@ -2791,7 +2842,7 @@ impl Player { /// *about* the timeline -- the marks under it are the whole preview -- so /// the bed stays readable and the card sits up in the picture area rather /// than over the lanes. - pub(crate) fn silence_card(&self, cx: &mut Context) -> Option { + pub(crate) fn silence_card(&self, viewport: Size, cx: &mut Context) -> Option { let (lane, idx) = self.silence_open?; let dark = self.darkroom; let cfg = self.silence; @@ -2971,6 +3022,7 @@ impl Player { // Light enough to read the lanes and the marks on them through: // the preview is the point of this card. .bg(rgba(SCRIM_LIGHT())) + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) // Click away closes it, as on every card here -- and the marks // go with it, which is what makes this one a call and not a flag. .on_mouse_down( @@ -2984,7 +3036,7 @@ impl Player { .child( div() .w_full() - .max_w(px(COLOR_W)) + .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width)))) .on_mouse_down(MouseButton::Left, swallow) .flex() .flex_col() @@ -2994,7 +3046,7 @@ impl Player { .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) .when(dark, |d| { - d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into()))) + d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)) }) .when(!dark, |d| { d.child(div().flex_none().px(px(6.)).child(format!( diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index dc6ce87..530ca59 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -44,6 +44,28 @@ fn save(src_active: bool) { let _ = std::fs::write(path, if src_active { "Src\n" } else { "Clip\n" }); } +/// Whether the room's one open param card is maximized -- the same +/// small-file round trip as the dock tab pick above, its own word beside it +/// ("a room reopens exactly as left", DESIGN.md:135), so a maximized EQ stays +/// maximized across a close and reopen of the whole room, not just the card. +pub(crate) fn maximized_config_path() -> std::path::PathBuf { + crate::keymap::Keymap::config_path().with_file_name("card-maximized") +} + +pub(crate) fn load_maximized() -> bool { + std::fs::read_to_string(maximized_config_path()) + .map(|text| text.trim() == "1") + .unwrap_or(false) +} + +pub(crate) fn save_maximized(maximized: bool) { + let path = maximized_config_path(); + if let Some(dir) = path.parent() { + let _ = std::fs::create_dir_all(dir); + } + let _ = std::fs::write(path, if maximized { "1\n" } else { "0\n" }); +} + /// The Sources tab's four sort chips (MOCK-SPEC "Dock" §3). `Recent` is the /// library's own arrival order -- the only order this editor tracks without /// a fourth field to keep it in. @@ -502,8 +524,8 @@ fn sources_tab(player: &Player, cx: &mut Context) -> impl IntoElement { /// 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. -fn clip_tab(player: &Player, width: f32, window_h: Pixels, cx: &mut Context) -> impl IntoElement { - let room = size(px(width), window_h); +fn clip_tab(player: &Player, width: f32, window_size: Size, cx: &mut Context) -> impl IntoElement { + let _ = width; let none_open = player.eq_open.is_none() && player.color_open.is_none() && player.transform_open.is_none() @@ -596,19 +618,19 @@ fn clip_tab(player: &Player, width: f32, window_h: Pixels, cx: &mut Context) -> impl IntoElement { +pub(crate) fn render(player: &Player, width: f32, window_size: Size, cx: &mut Context) -> impl IntoElement { let src_active = player.dock_src_active; div() .id("stance-dock-body") @@ -660,6 +682,6 @@ pub(crate) fn render(player: &Player, width: f32, window_h: Pixels, cx: &mut Con ) .child(match src_active { true => sources_tab(player, cx).into_any_element(), - false => clip_tab(player, width, window_h, cx).into_any_element(), + false => clip_tab(player, width, window_size, cx).into_any_element(), }) } diff --git a/crates/app/src/ui/stance.rs b/crates/app/src/ui/stance.rs index 4185f57..8a9208a 100644 --- a/crates/app/src/ui/stance.rs +++ b/crates/app/src/ui/stance.rs @@ -567,7 +567,7 @@ fn ledger(player: &Player, position: f64) -> impl IntoElement { /// The dock: the only side panel, right, fixed width, carrying the Src/Clip /// tab pair (DESIGN §5). The frame is drawn here; `dock_stance.rs` owns the /// tab row and both tabs' content (DESIGN §12 step 4). -fn dock(player: &Player, window_h: Pixels, cx: &mut Context) -> impl IntoElement { +fn dock(player: &Player, window_size: Size, cx: &mut Context) -> impl IntoElement { div() .id("stance-dock") .flex_none() @@ -578,7 +578,7 @@ fn dock(player: &Player, window_h: Pixels, cx: &mut Context) -> impl Int .border_color(rgba(DARK_SEAM())) .flex() .flex_col() - .child(dock_stance::render(player, DOCK_W, window_h, cx)) + .child(dock_stance::render(player, DOCK_W, window_size, cx)) } /// The whole stance: spine, screen, time band, bench, ledger, dock, in the @@ -780,5 +780,5 @@ pub(crate) fn render( .children(player.export_progress_card(cx)) .children(player.picker_card(window_size, cx)), ) - .child(dock(player, window_h, cx)) + .child(dock(player, window_size, cx)) }