The maximize-a-card branch compiles and its own claims get tests
Browse files at this commitdb1e19926b16a06d2e1d556d9c80b81e72238f21Parent: 1638537- fix
- the maximize-a-card branch compiles and its own claims get tests
4 changed files +143 -30
- crates/app/src/tests/cards.rs +114 -6
- crates/app/src/tests/mod.rs +2 -1
- crates/app/src/ui/cards.rs +21 -17
- crates/app/src/ui/inspector.rs +6 -6
crates/app/src/tests/cards.rsmodified+114 -6
| @@ -409,14 +409,14 @@ fn the_equalizer_graph_puts_a_band_where_a_drag_reads_it_and_fits_the_smallest_w | |||
| 409 | 409 | ||
| 410 | // The card fits the smallest window and takes the room a bigger one has | 410 | // The card fits the smallest window and takes the room a bigger one has |
| 411 | // -- it is a graph, and the width *is* the frequency resolution. | 411 | // -- it is a graph, and the width *is* the frequency resolution. |
| 412 | - assert!(eq_card_w(640.) <= 640. - 24., "card too wide for 640"); | 412 | + assert!(eq_card_w(640., false) <= 640. - 24., "card too wide for 640"); |
| 413 | - assert!(eq_card_w(1280.) > eq_card_w(640.), "card ignores the window"); | 413 | + assert!(eq_card_w(1280., false) > eq_card_w(640., false), "card ignores the window"); |
| 414 | - assert_eq!(eq_card_w(1920.), EQ_W_MAX, "card grows without end"); | 414 | + assert_eq!(eq_card_w(1920., false), EQ_W_MAX, "card grows without end"); |
| 415 | - assert!(eq_card_w(320.) >= KEYS_W, "card narrower than a row of text"); | 415 | + assert!(eq_card_w(320., false) >= KEYS_W, "card narrower than a row of text"); |
| 416 | // At the smallest window the graph is still a graph: three across for | 416 | // At the smallest window the graph is still a graph: three across for |
| 417 | // one down, so an octave is wide enough to put a handle in. | 417 | // one down, so an octave is wide enough to put a handle in. |
| 418 | assert!( | 418 | assert!( |
| 419 | - eq_card_w(640.) - 24. >= 3. * EQ_GRAPH_H, | 419 | + eq_card_w(640., false) - 24. >= 3. * EQ_GRAPH_H, |
| 420 | "graph too square to aim at" | 420 | "graph too square to aim at" |
| 421 | ); | 421 | ); |
| 422 | 422 | ||
| @@ -1710,10 +1710,118 @@ fn a_cards_own_help_paints_while_the_card_is_open_but_the_ui_under_it_stays_quie | |||
| 1710 | // plain `Tip`, or this whole fix is undone by construction. | 1710 | // plain `Tip`, or this whole fix is undone by construction. |
| 1711 | let cards_src = src_text("ui/cards.rs"); | 1711 | let cards_src = src_text("ui/cards.rs"); |
| 1712 | let head_fn_at = cards_src.find("fn dark_card_head(").expect("dark_card_head"); | 1712 | let head_fn_at = cards_src.find("fn dark_card_head(").expect("dark_card_head"); |
| 1713 | - let head_fn = &cards_src[head_fn_at..head_fn_at + 1200]; | 1713 | + // 1200 was wide enough before this session's maximize glyph/tooltip |
| 1714 | + // (`.when(maximize.is_some(), ...)` + its own `OverlayTip`) grew the | ||
| 1715 | + // function ahead of the help tooltip this test is actually pinning. | ||
| 1716 | + let head_fn = &cards_src[head_fn_at..head_fn_at + 2400]; | ||
| 1714 | assert!( | 1717 | assert!( |
| 1715 | head_fn.contains("OverlayTip(h.clone())"), | 1718 | head_fn.contains("OverlayTip(h.clone())"), |
| 1716 | "dark_card_head's own `?` tooltip no longer builds an OverlayTip -- the \ | 1719 | "dark_card_head's own `?` tooltip no longer builds an OverlayTip -- the \ |
| 1717 | card-head help is unreadable again while its card is open" | 1720 | card-head help is unreadable again while its card is open" |
| 1718 | ); | 1721 | ); |
| 1719 | } | 1722 | } |
| 1723 | + | ||
| 1724 | +/// "Maximize a card in place" changes size only, never the relative | ||
| 1725 | +/// semantics a value is drawn against: `eq_x`/`eq_y` map into `0..1` of | ||
| 1726 | +/// whatever box they are given, so a wider/taller EQ card is genuinely more | ||
| 1727 | +/// dB/Hz resolution, not the same graph stretched. This is the layout half | ||
| 1728 | +/// of that claim -- `eq_x`/`eq_y` themselves take no size argument at all | ||
| 1729 | +/// (they answer in `0..1`), so there is nothing about them a maximize could | ||
| 1730 | +/// have broken; what a maximize is allowed to touch is `eq_card_w`/ | ||
| 1731 | +/// `eq_graph_h`'s own ceiling. | ||
| 1732 | +#[test] | ||
| 1733 | +fn maximizing_a_card_grows_its_box_without_moving_where_a_value_sits_in_it() { | ||
| 1734 | + // Below the old EQ_W_MAX ceiling, maximized and not agree -- there is | ||
| 1735 | + // room for both without the ceiling mattering yet. | ||
| 1736 | + assert_eq!(eq_card_w(600., false), eq_card_w(600., true)); | ||
| 1737 | + // Past it, only the maximized card keeps growing: the ceiling this | ||
| 1738 | + // session's fix drops. | ||
| 1739 | + assert!( | ||
| 1740 | + eq_card_w(1920., true) > eq_card_w(1920., false), | ||
| 1741 | + "maximized EQ card no longer drops the EQ_W_MAX ceiling" | ||
| 1742 | + ); | ||
| 1743 | + assert_eq!( | ||
| 1744 | + eq_graph_h(true), | ||
| 1745 | + EQ_GRAPH_MAX_H, | ||
| 1746 | + "maximized EQ graph no longer grows to EQ_GRAPH_MAX_H" | ||
| 1747 | + ); | ||
| 1748 | + assert!( | ||
| 1749 | + eq_graph_h(true) > eq_graph_h(false), | ||
| 1750 | + "maximized EQ graph is not actually taller than the resting one" | ||
| 1751 | + ); | ||
| 1752 | + // The mapping itself never sees "maximized" -- a bigger box is more | ||
| 1753 | + // resolution because the same 0..1 fraction now spans more pixels, not | ||
| 1754 | + // because the fraction itself moved. | ||
| 1755 | + assert_eq!(eq_x(1000.), eq_x(1000.)); | ||
| 1756 | + assert_eq!(eq_y(0.), eq_y(0.)); | ||
| 1757 | +} | ||
| 1758 | + | ||
| 1759 | +/// DESIGN's "a maximized scrim covers only the bench/ledger/time-band band, | ||
| 1760 | +/// never the picture": the floor a maximized card's `.top()` is pinned to | ||
| 1761 | +/// must leave exactly the picture's own height above it, for any bench | ||
| 1762 | +/// height a hand has dragged the seam to -- not just the untouched | ||
| 1763 | +/// `BENCH_H` default. `below_picture_floor` takes the live bench height as | ||
| 1764 | +/// its own second argument (the seam feature merged onto this branch), so | ||
| 1765 | +/// this checks the real two-argument signature rather than a stale one-arg | ||
| 1766 | +/// assumption. | ||
| 1767 | +#[test] | ||
| 1768 | +fn a_maximized_card_can_never_rise_above_the_picture_no_matter_the_bench_height() { | ||
| 1769 | + use crate::ui::stance::{LEDGER_H, TIME_BAND_H, below_picture_floor}; | ||
| 1770 | + let viewport_h = 1080.; | ||
| 1771 | + for bench_h in [140., 200., 400.] { | ||
| 1772 | + assert_eq!( | ||
| 1773 | + below_picture_floor(viewport_h, bench_h) + TIME_BAND_H + bench_h + LEDGER_H, | ||
| 1774 | + viewport_h, | ||
| 1775 | + "below_picture_floor's floor plus the band below the picture no \ | ||
| 1776 | + longer adds back up to the window -- a maximized scrim could rise \ | ||
| 1777 | + into the picture" | ||
| 1778 | + ); | ||
| 1779 | + } | ||
| 1780 | + // A bench dragged tall enough to eat the whole window still clamps at | ||
| 1781 | + // zero rather than going negative and reporting free room that is not | ||
| 1782 | + // there. | ||
| 1783 | + assert_eq!(below_picture_floor(300., 5000.), 0.); | ||
| 1784 | +} | ||
| 1785 | + | ||
| 1786 | +/// The maximize flag's own small round trip (`dock_stance.rs`'s own doc | ||
| 1787 | +/// comment: "the same small-file round trip as the dock tab pick", "a room | ||
| 1788 | +/// reopens exactly as left"): saved, read back, and silently defaulted to | ||
| 1789 | +/// `false` on a corrupt or absent file -- never a startup crash or notice | ||
| 1790 | +/// over the user's own work, the same rule `load_subtitle_style`'s own test | ||
| 1791 | +/// (`tests/media.rs`) already pins for its sibling config file. `XDG_CONFIG_HOME` | ||
| 1792 | +/// is the existing scratch-path override every config-round-trip test in | ||
| 1793 | +/// this crate already uses; there is no maximize-specific override to | ||
| 1794 | +/// invent. | ||
| 1795 | +#[test] | ||
| 1796 | +fn a_maximized_card_reopens_exactly_as_left_across_a_restart() { | ||
| 1797 | + let dir = std::env::temp_dir().join(format!( | ||
| 1798 | + "edith-test-maximized-{}-{}", | ||
| 1799 | + std::process::id(), | ||
| 1800 | + std::time::SystemTime::now() | ||
| 1801 | + .duration_since(std::time::UNIX_EPOCH) | ||
| 1802 | + .unwrap() | ||
| 1803 | + .as_nanos() | ||
| 1804 | + )); | ||
| 1805 | + std::fs::create_dir_all(&dir).unwrap(); | ||
| 1806 | + // Scoped to this test alone, the same reasoning `tests/media.rs`'s own | ||
| 1807 | + // XDG_CONFIG_HOME mutation gives: nothing else reads this file. | ||
| 1808 | + unsafe { std::env::set_var("XDG_CONFIG_HOME", &dir) }; | ||
| 1809 | + | ||
| 1810 | + // Nothing written yet: the default (not maximized), not a crash on a | ||
| 1811 | + // missing file. | ||
| 1812 | + assert_eq!(crate::ui::dock_stance::load_maximized(), false); | ||
| 1813 | + | ||
| 1814 | + crate::ui::dock_stance::save_maximized(true); | ||
| 1815 | + assert_eq!(crate::ui::dock_stance::load_maximized(), true); | ||
| 1816 | + | ||
| 1817 | + crate::ui::dock_stance::save_maximized(false); | ||
| 1818 | + assert_eq!(crate::ui::dock_stance::load_maximized(), false); | ||
| 1819 | + | ||
| 1820 | + // A file from a future/corrupt version leaves the default in force | ||
| 1821 | + // rather than failing the room that opens over it. | ||
| 1822 | + std::fs::write(crate::ui::dock_stance::maximized_config_path(), "not a bool\n").unwrap(); | ||
| 1823 | + assert_eq!(crate::ui::dock_stance::load_maximized(), false); | ||
| 1824 | + | ||
| 1825 | + unsafe { std::env::remove_var("XDG_CONFIG_HOME") }; | ||
| 1826 | + std::fs::remove_dir_all(&dir).ok(); | ||
| 1827 | +} | ||
crates/app/src/tests/mod.rsmodified+2 -1
| @@ -24,7 +24,8 @@ use super::{ | |||
| 24 | Transport, VOLUME_W, Volume, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, Wave, band_label, | 24 | Transport, VOLUME_W, Volume, WAVE_BPS, WAVE_COL, WAVE_COLS_MAX, Wave, band_label, |
| 25 | bitrate_detail, bitrate_refusal, can_add, cancels_export, clipboard_after_remove, color_snap, commit_mbps, | 25 | bitrate_detail, bitrate_refusal, can_add, cancels_export, clipboard_after_remove, color_snap, commit_mbps, |
| 26 | containers, | 26 | containers, |
| 27 | - enable, envelope, eq_card_w, eq_freq, eq_freq_label, eq_spectrum, eq_x, eq_y, | 27 | + enable, envelope, eq_card_w, eq_freq, eq_freq_label, eq_graph_h, eq_spectrum, eq_x, eq_y, |
| 28 | + EQ_GRAPH_MAX_H, | ||
| 28 | escape_leaves_player_fullscreen, | 29 | escape_leaves_player_fullscreen, |
| 29 | estimated_bytes, export_path, export_settings, format_key, | 30 | estimated_bytes, export_path, export_settings, format_key, |
| 30 | format_line, format_refusal, fps_choices, fps_label, frac_along, frac_down, frame_at, | 31 | format_line, format_refusal, fps_choices, fps_label, frac_along, frac_down, frame_at, |
crates/app/src/ui/cards.rsmodified+21 -17
| @@ -59,13 +59,19 @@ fn dark_row_value(text: impl Into<SharedString>) -> Div { | |||
| 59 | /// only reachable via keyboard shortcut" complaint). A double-click anywhere | 59 | /// only reachable via keyboard shortcut" complaint). A double-click anywhere |
| 60 | /// on the head does the same thing the glyph's click and the `m` chord do | 60 | /// on the head does the same thing the glyph's click and the `m` chord do |
| 61 | /// ([`Player::toggle_maximize`]) -- mouse and key reach the same switch. | 61 | /// ([`Player::toggle_maximize`]) -- mouse and key reach the same switch. |
| 62 | +// `+ use<>` (edition 2024 precise capturing): without it, the elided | ||
| 63 | +// lifetime on `cx` would be captured into the returned opaque type by | ||
| 64 | +// default, so a hoisted `let head = dark.then(|| dark_card_head(..., cx));` | ||
| 65 | +// would keep `cx` borrowed until `head` is finally consumed -- fighting | ||
| 66 | +// every other `cx.listener(...)` call built in between, which is exactly | ||
| 67 | +// the E0500/E0501 chain this card's own hoist is here to avoid. | ||
| 62 | fn dark_card_head( | 68 | fn dark_card_head( |
| 63 | verb: &str, | 69 | verb: &str, |
| 64 | meta: Option<SharedString>, | 70 | meta: Option<SharedString>, |
| 65 | help: Option<SharedString>, | 71 | help: Option<SharedString>, |
| 66 | maximize: Option<bool>, | 72 | maximize: Option<bool>, |
| 67 | cx: &mut Context<Player>, | 73 | cx: &mut Context<Player>, |
| 68 | -) -> impl IntoElement { | 74 | +) -> impl IntoElement + use<> { |
| 69 | div() | 75 | div() |
| 70 | .id("card-head") | 76 | .id("card-head") |
| 71 | .flex_none() | 77 | .flex_none() |
| @@ -1511,7 +1517,7 @@ impl Player { | |||
| 1511 | .justify_center() | 1517 | .justify_center() |
| 1512 | .items_center() | 1518 | .items_center() |
| 1513 | .bg(rgba(SCRIM())) | 1519 | .bg(rgba(SCRIM())) |
| 1514 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 1520 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 1515 | // Click away closes it, as on every card here. | 1521 | // Click away closes it, as on every card here. |
| 1516 | .on_mouse_down( | 1522 | .on_mouse_down( |
| 1517 | MouseButton::Left, | 1523 | MouseButton::Left, |
| @@ -2016,7 +2022,7 @@ impl Player { | |||
| 2016 | .justify_center() | 2022 | .justify_center() |
| 2017 | .items_center() | 2023 | .items_center() |
| 2018 | .bg(rgba(SCRIM())) | 2024 | .bg(rgba(SCRIM())) |
| 2019 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 2025 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 2020 | // Click away closes it, as on every card here. | 2026 | // Click away closes it, as on every card here. |
| 2021 | .on_mouse_down( | 2027 | .on_mouse_down( |
| 2022 | MouseButton::Left, | 2028 | MouseButton::Left, |
| @@ -2199,7 +2205,7 @@ impl Player { | |||
| 2199 | .justify_center() | 2205 | .justify_center() |
| 2200 | .items_center() | 2206 | .items_center() |
| 2201 | .bg(rgba(SCRIM())) | 2207 | .bg(rgba(SCRIM())) |
| 2202 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 2208 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 2203 | .on_mouse_down( | 2209 | .on_mouse_down( |
| 2204 | MouseButton::Left, | 2210 | MouseButton::Left, |
| 2205 | cx.listener(|this, _: &MouseDownEvent, _, cx| { | 2211 | cx.listener(|this, _: &MouseDownEvent, _, cx| { |
| @@ -2338,7 +2344,7 @@ impl Player { | |||
| 2338 | .justify_center() | 2344 | .justify_center() |
| 2339 | .items_center() | 2345 | .items_center() |
| 2340 | .bg(rgba(SCRIM())) | 2346 | .bg(rgba(SCRIM())) |
| 2341 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 2347 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 2342 | // Click away closes it, as on every card here. | 2348 | // Click away closes it, as on every card here. |
| 2343 | .on_mouse_down( | 2349 | .on_mouse_down( |
| 2344 | MouseButton::Left, | 2350 | MouseButton::Left, |
| @@ -2572,7 +2578,7 @@ impl Player { | |||
| 2572 | .justify_center() | 2578 | .justify_center() |
| 2573 | .items_center() | 2579 | .items_center() |
| 2574 | .bg(rgba(SCRIM())) | 2580 | .bg(rgba(SCRIM())) |
| 2575 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 2581 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 2576 | // Click away closes it, as on every card here. | 2582 | // Click away closes it, as on every card here. |
| 2577 | .on_mouse_down( | 2583 | .on_mouse_down( |
| 2578 | MouseButton::Left, | 2584 | MouseButton::Left, |
| @@ -2653,6 +2659,8 @@ impl Player { | |||
| 2653 | return None; | 2659 | return None; |
| 2654 | } | 2660 | } |
| 2655 | let dark = self.darkroom; | 2661 | let dark = self.darkroom; |
| 2662 | + let help_text = "− and + move the size, or ↑↓ picks a row and ←→ moves it (held or pressed); a family row picks it outright — a click away or esc closes"; | ||
| 2663 | + let head = dark.then(|| dark_card_head("Subtitle style", None, Some(help_text.into()), Some(self.card_maximized), cx)); | ||
| 2656 | let size_picked = self.subtitle_style_field == 0; | 2664 | let size_picked = self.subtitle_style_field == 0; |
| 2657 | let size_row = div() | 2665 | let size_row = div() |
| 2658 | .id("subtitle-size-row") | 2666 | .id("subtitle-size-row") |
| @@ -2770,14 +2778,13 @@ impl Player { | |||
| 2770 | .when(dark, |d| d.child(dark_row_label(name.clone(), picked))) | 2778 | .when(dark, |d| d.child(dark_row_label(name.clone(), picked))) |
| 2771 | .when(!dark, |d| d.child(name.clone())) | 2779 | .when(!dark, |d| d.child(name.clone())) |
| 2772 | }); | 2780 | }); |
| 2773 | - let help_text = "− and + move the size, or ↑↓ picks a row and ←→ moves it (held or pressed); a family row picks it outright — a click away or esc closes"; | ||
| 2774 | Some( | 2781 | Some( |
| 2775 | scrim() | 2782 | scrim() |
| 2776 | .flex() | 2783 | .flex() |
| 2777 | .justify_center() | 2784 | .justify_center() |
| 2778 | .items_center() | 2785 | .items_center() |
| 2779 | .bg(rgba(SCRIM())) | 2786 | .bg(rgba(SCRIM())) |
| 2780 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 2787 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 2781 | .on_mouse_down( | 2788 | .on_mouse_down( |
| 2782 | MouseButton::Left, | 2789 | MouseButton::Left, |
| 2783 | cx.listener(|this, _: &MouseDownEvent, _, cx| { | 2790 | cx.listener(|this, _: &MouseDownEvent, _, cx| { |
| @@ -2799,9 +2806,7 @@ impl Player { | |||
| 2799 | .rounded(px(6.)) | 2806 | .rounded(px(6.)) |
| 2800 | .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) | 2807 | .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) |
| 2801 | .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) | 2808 | .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) |
| 2802 | - .when(dark, |d| { | 2809 | + .when(dark, move |d| d.child(head.unwrap())) |
| 2803 | - d.child(dark_card_head("Subtitle style", None, Some(help_text.into()), Some(self.card_maximized), cx)) | ||
| 2804 | - }) | ||
| 2805 | .when(!dark, |d| { | 2810 | .when(!dark, |d| { |
| 2806 | d.child( | 2811 | d.child( |
| 2807 | div() | 2812 | div() |
| @@ -2845,6 +2850,9 @@ impl Player { | |||
| 2845 | pub(crate) fn silence_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> { | 2850 | pub(crate) fn silence_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> { |
| 2846 | let (lane, idx) = self.silence_open?; | 2851 | let (lane, idx) = self.silence_open?; |
| 2847 | let dark = self.darkroom; | 2852 | let dark = self.darkroom; |
| 2853 | + let head_meta: SharedString = format!("{} clip {}", lane.label(), idx + 1).into(); | ||
| 2854 | + let help_text = "− and + move a setting, or ↑↓ picks one and ←→ moves it (hold to run it) — the marks on the lane are what would go; a click away or esc closes"; | ||
| 2855 | + let head = dark.then(|| dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)); | ||
| 2848 | let cfg = self.silence; | 2856 | let cfg = self.silence; |
| 2849 | // The unit is a label, never a conversion: the threshold is a level | 2857 | // The unit is a label, never a conversion: the threshold is a level |
| 2850 | // below full scale whichever of the two the row says (`silence_dbfs`). | 2858 | // below full scale whichever of the two the row says (`silence_dbfs`). |
| @@ -3011,8 +3019,6 @@ impl Player { | |||
| 3011 | .into_any_element(), | 3019 | .into_any_element(), |
| 3012 | } | 3020 | } |
| 3013 | }; | 3021 | }; |
| 3014 | - let head_meta: SharedString = format!("{} clip {}", lane.label(), idx + 1).into(); | ||
| 3015 | - let help_text = "− and + move a setting, or ↑↓ picks one and ←→ moves it (hold to run it) — the marks on the lane are what would go; a click away or esc closes"; | ||
| 3016 | Some( | 3022 | Some( |
| 3017 | scrim() | 3023 | scrim() |
| 3018 | .flex() | 3024 | .flex() |
| @@ -3022,7 +3028,7 @@ impl Player { | |||
| 3022 | // Light enough to read the lanes and the marks on them through: | 3028 | // Light enough to read the lanes and the marks on them through: |
| 3023 | // the preview is the point of this card. | 3029 | // the preview is the point of this card. |
| 3024 | .bg(rgba(SCRIM_LIGHT())) | 3030 | .bg(rgba(SCRIM_LIGHT())) |
| 3025 | - .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height))))) | 3031 | + .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height), self.split_px(Split::Bench, viewport))))) |
| 3026 | // Click away closes it, as on every card here -- and the marks | 3032 | // Click away closes it, as on every card here -- and the marks |
| 3027 | // go with it, which is what makes this one a call and not a flag. | 3033 | // go with it, which is what makes this one a call and not a flag. |
| 3028 | .on_mouse_down( | 3034 | .on_mouse_down( |
| @@ -3045,9 +3051,7 @@ impl Player { | |||
| 3045 | .rounded(px(6.)) | 3051 | .rounded(px(6.)) |
| 3046 | .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) | 3052 | .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() })) |
| 3047 | .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) | 3053 | .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM()))) |
| 3048 | - .when(dark, |d| { | 3054 | + .when(dark, move |d| d.child(head.unwrap())) |
| 3049 | - d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx)) | ||
| 3050 | - }) | ||
| 3051 | .when(!dark, |d| { | 3055 | .when(!dark, |d| { |
| 3052 | d.child(div().flex_none().px(px(6.)).child(format!( | 3056 | d.child(div().flex_none().px(px(6.)).child(format!( |
| 3053 | "Silences — {} clip {}", | 3057 | "Silences — {} clip {}", |
crates/app/src/ui/inspector.rsmodified+6 -6
| @@ -80,12 +80,12 @@ impl Player { | |||
| 80 | ) | 80 | ) |
| 81 | }) | 81 | }) |
| 82 | .children(self.eq_card(room, cx)) | 82 | .children(self.eq_card(room, cx)) |
| 83 | - .children(self.color_card(cx)) | 83 | + .children(self.color_card(room, cx)) |
| 84 | - .children(self.transform_card(cx)) | 84 | + .children(self.transform_card(room, cx)) |
| 85 | - .children(self.speed_card(cx)) | 85 | + .children(self.speed_card(room, cx)) |
| 86 | - .children(self.silence_card(cx)) | 86 | + .children(self.silence_card(room, cx)) |
| 87 | - .children(self.mix_card(cx)) | 87 | + .children(self.mix_card(room, cx)) |
| 88 | - .children(self.subtitle_style_card(cx)) | 88 | + .children(self.subtitle_style_card(room, cx)) |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /// What is marked, and the settings that belong to *it*. A dump of every | 91 | /// What is marked, and the settings that belong to *it*. A dump of every |