forge
Explore
Log in

Don't you dare go Hollow

wip(ui): maximize a card in place — DOES NOT COMPILE

Browse files at this commit

c8ac6d0a1e4914044d2358fc602b4b068cc88ac8Ahmet Kaan GümüşParent: 0e6e486
Checkpoint so the work survives. Two known breaks: E0500 borrow conflicts in
subtitle_style_card and silence_card, and six stale call sites in the legacy
inspector that still pass the old one-argument card signature.
crates/app/src/audio_cards.rsmodified+15 -0
@@ -119,6 +119,21 @@ pub(crate) const EQ_FREQ_HIGH: f32 = 20_000.;
119 /// and short enough that the card still fits a 360 px window.119 /// and short enough that the card still fits a 360 px window.
120 pub(crate) const EQ_GRAPH_H: f32 = 132.;120 pub(crate) const EQ_GRAPH_H: f32 = 132.;
121 121
122+/// The curve box maximized: 1 dB and a semitone-ish band of frequency both
123+/// read as more pixels than the docked floor spends on them -- the same
124+/// curve, the same ±12 dB axis and the same 20 Hz-20 kHz sweep, just spread
125+/// over more of the vertical resolution a maximized card borrows from the
126+/// bench/ledger rows below the picture ([`crate::ui::stance::below_picture_floor`]).
127+pub(crate) const EQ_GRAPH_MAX_H: f32 = 320.;
128+
129+/// The graph's own height for the card's current size: the docked floor, or
130+/// the maximized card's own taller box -- never a CSS scale of the same
131+/// pixels, an actually taller curve with more room per decibel and per
132+/// decade.
133+pub(crate) fn eq_graph_h(maximized: bool) -> f32 {
134+ if maximized { EQ_GRAPH_MAX_H } else { EQ_GRAPH_H }
135+}
136+
122 /// How wide the equalizer card is allowed to get. It is the one card that is a137 /// How wide the equalizer card is allowed to get. It is the one card that is a
123 /// *graph*: every pixel across is frequency resolution, and at the 320 px the138 /// *graph*: every pixel across is frequency resolution, and at the 320 px the
124 /// other cards use, a third of an octave was a couple of pixels. Past this the139 /// other cards use, a third of an octave was a couple of pixels. Past this the
crates/app/src/library_meta.rsmodified+22 -2
@@ -320,8 +320,28 @@ pub(crate) fn unusable(info: &StreamInfo, timeline_audio: Option<(u32, u16)>) ->
320 /// thousand hertz on 320 px spends four pixels on the octave below middle C --320 /// thousand hertz on 320 px spends four pixels on the octave below middle C --
321 /// so it takes the room a big window has and stays inside a small one. Floored321 /// so it takes the room a big window has and stays inside a small one. Floored
322 /// at the other cards' width, which is the last size the rows still read at.322 /// at the other cards' width, which is the last size the rows still read at.
323-pub(crate) fn eq_card_w(window_w: f32) -> f32 {323+pub(crate) fn eq_card_w(window_w: f32, maximized: bool) -> f32 {
324- (window_w - EQ_W_MARGIN).clamp(KEYS_W, EQ_W_MAX)324+ let raw = window_w - EQ_W_MARGIN;
325+ if maximized {
326+ // Maximized drops the [`EQ_W_MAX`] ceiling: every pixel across is
327+ // frequency resolution (the doc comment above), and a maximized card
328+ // is asking for exactly the room a big window has to give it.
329+ raw.max(KEYS_W)
330+ } else {
331+ raw.clamp(KEYS_W, EQ_W_MAX)
332+ }
333+}
334+
335+/// How wide a non-EQ param card is drawn: its usual fixed width, or (when
336+/// maximized) all of the window bar the same margin the EQ card gives
337+/// itself -- never narrower than its own floor, so a small window's
338+/// maximize is a no-op rather than a shrink.
339+pub(crate) fn card_max_w(base_w: f32, maximized: bool, window_w: f32) -> f32 {
340+ if maximized {
341+ (window_w - EQ_W_MARGIN).max(base_w)
342+ } else {
343+ base_w
344+ }
325 }345 }
326 346
327 /// What the media list is given of the window. A share of it, so a narrow347 /// What the media list is given of the window. A share of it, so a narrow
crates/app/src/main.rsmodified+8 -0
@@ -571,6 +571,13 @@ struct Player {
571 /// the card is modal: while it is up nothing else can move an index, and571 /// the card is modal: while it is up nothing else can move an index, and
572 /// the one edit it makes (`set_eq`) moves none.572 /// the one edit it makes (`set_eq`) moves none.
573 eq_open: Option<(Lane, usize)>,573 eq_open: Option<(Lane, usize)>,
574+ /// Whichever of the seven param cards is open, filling the room in place
575+ /// of the bench/ledger rows instead of its usual capped, floating size
576+ /// (`Player::toggle_maximize`). One flag, not one per card, because only
577+ /// one of them is ever open at a time (`close_card`'s own rule) and it
578+ /// outlives any one card's close/reopen, persisted like the dock tab pick
579+ /// (`ui::dock_stance::load_maximized`/`save_maximized`).
580+ card_maximized: bool,
574 /// The curve the card is showing, which is the clip's own or the flat581 /// The curve the card is showing, which is the clip's own or the flat
575 /// five-band default. Edited live and written at the clip once per gesture582 /// five-band default. Edited live and written at the clip once per gesture
576 /// ([`Player::commit_eq`]): the project's equalizer table is append-only, so583 /// ([`Player::commit_eq`]): the project's equalizer table is append-only, so
@@ -954,6 +961,7 @@ fn main() {
954 export_refusals_inline: false,961 export_refusals_inline: false,
955 export_advanced_open: false,962 export_advanced_open: false,
956 eq_open: None,963 eq_open: None,
964+ card_maximized: ui::dock_stance::load_maximized(),
957 // Replaced by the clip's own curve the moment the card965 // Replaced by the clip's own curve the moment the card
958 // opens; nothing reads it before that.966 // opens; nothing reads it before that.
959 eq_params: EqParams::default(),967 eq_params: EqParams::default(),
crates/app/src/player/cards.rsmodified+49 -4
@@ -1283,6 +1283,17 @@ impl Player {
1283 self.subtitle_style_open = false;1283 self.subtitle_style_open = false;
1284 }1284 }
1285 1285
1286+ /// The one switch every param card's expand affordance and its `m`
1287+ /// chord both flip (`dark_card_head`, [`Player::param_card_key`]):
1288+ /// whichever card is open trades its usual capped, floating size for the
1289+ /// bench/ledger rows' own room, in place -- layout only, no value on the
1290+ /// card changes. Persisted like the dock tab pick so a maximized EQ is
1291+ /// still maximized after the room closes and reopens.
1292+ pub(crate) fn toggle_maximize(&mut self) {
1293+ self.card_maximized = !self.card_maximized;
1294+ ui::dock_stance::save_maximized(self.card_maximized);
1295+ }
1296+
1286 /// Opens the equalizer on the selected clip. Audio only, and it says so1297 /// Opens the equalizer on the selected clip. Audio only, and it says so
1287 /// rather than opening a card of bands that would reach nothing: a video1298 /// rather than opening a card of bands that would reach nothing: a video
1288 /// clip carries no sound of its own here (the sound is the audio lane's),1299 /// clip carries no sound of its own here (the sound is the audio lane's),
@@ -1459,8 +1470,32 @@ impl Player {
1459 /// and ate the key, the caller's cue to `cx.notify()` and stop exactly1470 /// and ate the key, the caller's cue to `cx.notify()` and stop exactly
1460 /// where each of these branches used to `return` inline.1471 /// where each of these branches used to `return` inline.
1461 pub(crate) fn param_card_key(&mut self, key: &str, shift: bool, cx: &mut Context<Self>) -> bool {1472 pub(crate) fn param_card_key(&mut self, key: &str, shift: bool, cx: &mut Context<Self>) -> bool {
1473+ // The one chord every param card answers to, wherever the pointer
1474+ // toggle sits in `dark_card_head` -- mouse and key reach the same
1475+ // switch (DESIGN's repeated "some options are only reachable via
1476+ // keyboard shortcut" complaint). Checked once, ahead of the seven
1477+ // card-local branches below, because it means the same thing in all
1478+ // of them: none of the seven uses bare "m" for anything else.
1479+ if key == "m"
1480+ && (self.eq_open.is_some()
1481+ || self.color_open.is_some()
1482+ || self.transform_open.is_some()
1483+ || self.speed_open.is_some()
1484+ || self.silence_open.is_some()
1485+ || self.mix_open
1486+ || self.subtitle_style_open)
1487+ {
1488+ self.toggle_maximize();
1489+ return true;
1490+ }
1462 if self.eq_open.is_some() {1491 if self.eq_open.is_some() {
1463 if key == ESCAPE {1492 if key == ESCAPE {
1493+ // Maximized comes off before the card does -- "esc always
1494+ // retreats" one step at a time (DESIGN.md:146).
1495+ if self.card_maximized {
1496+ self.toggle_maximize();
1497+ return true;
1498+ }
1464 // Nothing to undo: every change is already at the clip, and1499 // Nothing to undo: every change is already at the clip, and
1465 // undo is undo's own key.1500 // undo is undo's own key.
1466 self.eq_open = None;1501 self.eq_open = None;
@@ -1516,6 +1551,7 @@ impl Player {
1516 // menu still lists them.1551 // menu still lists them.
1517 if self.color_open.is_some() {1552 if self.color_open.is_some() {
1518 match color_key(key) {1553 match color_key(key) {
1554+ Some(ColorKey::Close) if self.card_maximized => self.toggle_maximize(),
1519 Some(ColorKey::Close) => {1555 Some(ColorKey::Close) => {
1520 self.color_open = None;1556 self.color_open = None;
1521 self.color_dragging = false;1557 self.color_dragging = false;
@@ -1537,7 +1573,9 @@ impl Player {
1537 // the keys menu still lists them).1573 // the keys menu still lists them).
1538 if self.transform_open.is_some() {1574 if self.transform_open.is_some() {
1539 let n = TRANSFORM_BANDS.len();1575 let n = TRANSFORM_BANDS.len();
1540- if key == ESCAPE {1576+ if key == ESCAPE && self.card_maximized {
1577+ self.toggle_maximize();
1578+ } else if key == ESCAPE {
1541 self.transform_open = None;1579 self.transform_open = None;
1542 self.transform_dragging = false;1580 self.transform_dragging = false;
1543 } else if key == "down" {1581 } else if key == "down" {
@@ -1559,6 +1597,7 @@ impl Player {
1559 // menu still lists them).1597 // menu still lists them).
1560 if self.speed_open.is_some() {1598 if self.speed_open.is_some() {
1561 match color_key(key) {1599 match color_key(key) {
1600+ Some(ColorKey::Close) if self.card_maximized => self.toggle_maximize(),
1562 Some(ColorKey::Close) => {1601 Some(ColorKey::Close) => {
1563 self.speed_open = None;1602 self.speed_open = None;
1564 self.speed_dragging = false;1603 self.speed_dragging = false;
@@ -1579,7 +1618,9 @@ impl Player {
1579 // the keys menu (keymap.rs `FIXED`), because a key that cuts forty1618 // the keys menu (keymap.rs `FIXED`), because a key that cuts forty
1580 // places at once is not a secret.1619 // places at once is not a secret.
1581 if self.silence_open.is_some() {1620 if self.silence_open.is_some() {
1582- if key == ESCAPE {1621+ if key == ESCAPE && self.card_maximized {
1622+ self.toggle_maximize();
1623+ } else if key == ESCAPE {
1583 // Nothing to undo: a preview is not an edit.1624 // Nothing to undo: a preview is not an edit.
1584 self.close_silence();1625 self.close_silence();
1585 } else if key == "down" {1626 } else if key == "down" {
@@ -1602,7 +1643,9 @@ impl Player {
1602 // it, held or pressed. Card-local like the four above it.1643 // it, held or pressed. Card-local like the four above it.
1603 if self.mix_open {1644 if self.mix_open {
1604 let rows = self.mix_lanes().len() + MIX_MASTER_ROWS;1645 let rows = self.mix_lanes().len() + MIX_MASTER_ROWS;
1605- if key == ESCAPE {1646+ if key == ESCAPE && self.card_maximized {
1647+ self.toggle_maximize();
1648+ } else if key == ESCAPE {
1606 self.mix_open = false;1649 self.mix_open = false;
1607 } else if key == "down" {1650 } else if key == "down" {
1608 self.mix_field = (self.mix_field + 1) % rows;1651 self.mix_field = (self.mix_field + 1) % rows;
@@ -1625,7 +1668,9 @@ impl Player {
1625 // Row 0 is the size stepper, row 1 the platform default, and1668 // Row 0 is the size stepper, row 1 the platform default, and
1626 // every row after it a family in `subtitle_fonts`.1669 // every row after it a family in `subtitle_fonts`.
1627 let rows = 2 + self.subtitle_fonts.len();1670 let rows = 2 + self.subtitle_fonts.len();
1628- if key == ESCAPE {1671+ if key == ESCAPE && self.card_maximized {
1672+ self.toggle_maximize();
1673+ } else if key == ESCAPE {
1629 self.subtitle_style_open = false;1674 self.subtitle_style_open = false;
1630 } else if key == "down" {1675 } else if key == "down" {
1631 self.subtitle_style_field = (self.subtitle_style_field + 1) % rows;1676 self.subtitle_style_field = (self.subtitle_style_field + 1) % rows;
crates/app/src/ui/cards.rsmodified+75 -23
@@ -51,13 +51,56 @@ fn dark_row_value(text: impl Into<SharedString>) -> Div {
51 /// directly); now it rides a `?` glyph beside the head and only shows on51 /// directly); now it rides a `?` glyph beside the head and only shows on
52 /// hover, the same hover-only convention [`dock_stance::ghost_verb`]52 /// hover, the same hover-only convention [`dock_stance::ghost_verb`]
53 /// already uses for a verb's own description.53 /// already uses for a verb's own description.
54-fn dark_card_head(verb: &str, meta: Option<SharedString>, help: Option<SharedString>) -> Div {54+/// `maximize` is `None` for the one card this head builds that is not one of
55+/// the seven param cards (the export progress sheet): everything else passes
56+/// `Some(self.card_maximized)` and gets the affordance this session's
57+/// complaint asked for -- worn on the head (DESIGN.md:91's "chord is worn"),
58+/// so it never was a keyboard-only option (the repeated "some options are
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
61+/// ([`Player::toggle_maximize`]) -- mouse and key reach the same switch.
62+fn dark_card_head(
63+ verb: &str,
64+ meta: Option<SharedString>,
65+ help: Option<SharedString>,
66+ maximize: Option<bool>,
67+ cx: &mut Context<Player>,
68+) -> impl IntoElement {
55 div()69 div()
70+ .id("card-head")
56 .flex_none()71 .flex_none()
57 .px(px(6.))72 .px(px(6.))
58 .flex()73 .flex()
59 .items_baseline()74 .items_baseline()
60 .gap(px(6.))75 .gap(px(6.))
76+ .when(maximize.is_some(), |d| {
77+ d.on_mouse_down(
78+ MouseButton::Left,
79+ cx.listener(|this, event: &MouseDownEvent, _, cx| {
80+ if event.click_count >= 2 {
81+ this.toggle_maximize();
82+ cx.notify();
83+ }
84+ }),
85+ )
86+ })
87+ .children(maximize.map(|max| {
88+ div()
89+ .id("card-head-maximize")
90+ .flex_none()
91+ .cursor_pointer()
92+ .type_style(type_scale::mono(type_scale::CHORD_METADATA_MAX_PX, gpui::FontWeight::MEDIUM))
93+ .text_color(rgb(INK3()))
94+ .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
95+ this.toggle_maximize();
96+ cx.notify();
97+ }))
98+ .tooltip(move |_, cx| {
99+ cx.new(|_| OverlayTip(if max { "m -- back to the room".into() } else { "m -- fills the room".into() }))
100+ .into()
101+ })
102+ .child(if max { "▣ m" } else { "⤢ m" })
103+ }))
61 .child(104 .child(
62 div()105 div()
63 .type_style(type_scale::head())106 .type_style(type_scale::head())
@@ -1094,7 +1137,7 @@ impl Player {
1094 .rounded(px(6.))1137 .rounded(px(6.))
1095 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))1138 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1096 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))1139 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1097- .when(dark, |d| d.child(dark_card_head("Exporting", None, None)))1140+ .when(dark, |d| d.child(dark_card_head("Exporting", None, None, None, cx)))
1098 .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting")))1141 .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting")))
1099 // The bar itself: the same number as the percentage1142 // The bar itself: the same number as the percentage
1100 // below it, and it only ever moves forward -- the1143 // below it, and it only ever moves forward -- the
@@ -1335,7 +1378,7 @@ impl Player {
1335 .id("eq-graph")1378 .id("eq-graph")
1336 .relative()1379 .relative()
1337 .flex_none()1380 .flex_none()
1338- .h(px(EQ_GRAPH_H))1381+ .h(px(eq_graph_h(dark && self.card_maximized)))
1339 .rounded(px(3.))1382 .rounded(px(3.))
1340 .bg(rgb(if dark { DARK_HAIRLINE() } else { BG_HOVER_DIM() }))1383 .bg(rgb(if dark { DARK_HAIRLINE() } else { BG_HOVER_DIM() }))
1341 .cursor_pointer()1384 .cursor_pointer()
@@ -1468,6 +1511,7 @@ impl Player {
1468 .justify_center()1511 .justify_center()
1469 .items_center()1512 .items_center()
1470 .bg(rgba(SCRIM()))1513 .bg(rgba(SCRIM()))
1514+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
1471 // Click away closes it, as on every card here.1515 // Click away closes it, as on every card here.
1472 .on_mouse_down(1516 .on_mouse_down(
1473 MouseButton::Left,1517 MouseButton::Left,
@@ -1486,7 +1530,7 @@ impl Player {
1486 // of the window. The two cards beside it are built this1530 // of the window. The two cards beside it are built this
1487 // way for the same reason.1531 // way for the same reason.
1488 .w_full()1532 .w_full()
1489- .max_w(px(eq_card_w(f32::from(viewport.width))))1533+ .max_w(px(eq_card_w(f32::from(viewport.width), self.card_maximized)))
1490 // And a cap the other way, for the same reason the width1534 // And a cap the other way, for the same reason the width
1491 // has one: the card is docked in a column now, and at the1535 // has one: the card is docked in a column now, and at the
1492 // 360 px floor it is taller than that column -- its title1536 // 360 px floor it is taller than that column -- its title
@@ -1519,7 +1563,9 @@ impl Player {
1519 d.child(dark_card_head(1563 d.child(dark_card_head(
1520 "Equalizer",1564 "Equalizer",
1521 Some(format!("{} clip {}", lane.label(), idx + 1).into()),1565 Some(format!("{} clip {}", lane.label(), idx + 1).into()),
1522- 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()),1566+ 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()),
1567+ Some(self.card_maximized),
1568+ cx,
1523 ))1569 ))
1524 })1570 })
1525 .when(!dark, |d| {1571 .when(!dark, |d| {
@@ -1871,7 +1917,7 @@ impl Player {
1871 /// the decoder is grading with, never a copy that could drift from it. The1917 /// the decoder is grading with, never a copy that could drift from it. The
1872 /// graph above them is counted off the frame that came *back* through that1918 /// graph above them is counted off the frame that came *back* through that
1873 /// grade ([`histogram`]), so pulling exposure tilts it while the hand moves.1919 /// grade ([`histogram`]), so pulling exposure tilts it while the hand moves.
1874- pub(crate) fn color_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {1920+ pub(crate) fn color_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
1875 let (lane, idx) = self.color_open?;1921 let (lane, idx) = self.color_open?;
1876 let params = self.color_params();1922 let params = self.color_params();
1877 let dark = self.darkroom;1923 let dark = self.darkroom;
@@ -1970,6 +2016,7 @@ impl Player {
1970 .justify_center()2016 .justify_center()
1971 .items_center()2017 .items_center()
1972 .bg(rgba(SCRIM()))2018 .bg(rgba(SCRIM()))
2019+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
1973 // Click away closes it, as on every card here.2020 // Click away closes it, as on every card here.
1974 .on_mouse_down(2021 .on_mouse_down(
1975 MouseButton::Left,2022 MouseButton::Left,
@@ -1982,7 +2029,7 @@ impl Player {
1982 .child(2029 .child(
1983 div()2030 div()
1984 .w_full()2031 .w_full()
1985- .max_w(px(COLOR_W))2032+ .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width))))
1986 .on_mouse_down(MouseButton::Left, swallow)2033 .on_mouse_down(MouseButton::Left, swallow)
1987 .flex()2034 .flex()
1988 .flex_col()2035 .flex_col()
@@ -1992,7 +2039,7 @@ impl Player {
1992 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2039 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1993 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2040 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1994 .when(dark, |d| {2041 .when(dark, |d| {
1995- d.child(dark_card_head("Colour", Some(head_meta.clone()), Some(help_text.into())))2042+ d.child(dark_card_head("Colour", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx))
1996 })2043 })
1997 .when(!dark, |d| {2044 .when(!dark, |d| {
1998 d.child(div().flex_none().px(px(6.)).child(format!(2045 d.child(div().flex_none().px(px(6.)).child(format!(
@@ -2062,7 +2109,7 @@ impl Player {
2062 /// The transform card: [`color_card`](Self::color_card)'s own shape, one2109 /// The transform card: [`color_card`](Self::color_card)'s own shape, one
2063 /// row per [`TRANSFORM_BANDS`] entry instead of four, and no histogram --2110 /// row per [`TRANSFORM_BANDS`] entry instead of four, and no histogram --
2064 /// there is nothing here a graded frame would tilt.2111 /// there is nothing here a graded frame would tilt.
2065- pub(crate) fn transform_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {2112+ pub(crate) fn transform_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
2066 let (lane, idx) = self.transform_open?;2113 let (lane, idx) = self.transform_open?;
2067 let params = self.transform_params();2114 let params = self.transform_params();
2068 let dark = self.darkroom;2115 let dark = self.darkroom;
@@ -2152,6 +2199,7 @@ impl Player {
2152 .justify_center()2199 .justify_center()
2153 .items_center()2200 .items_center()
2154 .bg(rgba(SCRIM()))2201 .bg(rgba(SCRIM()))
2202+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
2155 .on_mouse_down(2203 .on_mouse_down(
2156 MouseButton::Left,2204 MouseButton::Left,
2157 cx.listener(|this, _: &MouseDownEvent, _, cx| {2205 cx.listener(|this, _: &MouseDownEvent, _, cx| {
@@ -2163,7 +2211,7 @@ impl Player {
2163 .child(2211 .child(
2164 div()2212 div()
2165 .w_full()2213 .w_full()
2166- .max_w(px(TRANSFORM_W))2214+ .max_w(px(card_max_w(TRANSFORM_W, self.card_maximized, f32::from(viewport.width))))
2167 .on_mouse_down(MouseButton::Left, swallow)2215 .on_mouse_down(MouseButton::Left, swallow)
2168 .flex()2216 .flex()
2169 .flex_col()2217 .flex_col()
@@ -2173,7 +2221,7 @@ impl Player {
2173 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2221 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2174 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2222 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2175 .when(dark, |d| {2223 .when(dark, |d| {
2176- d.child(dark_card_head("Transform", Some(head_meta.clone()), Some(help_text.into())))2224+ d.child(dark_card_head("Transform", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx))
2177 })2225 })
2178 .when(!dark, |d| {2226 .when(!dark, |d| {
2179 d.child(div().flex_none().px(px(6.)).child(format!(2227 d.child(div().flex_none().px(px(6.)).child(format!(
@@ -2236,7 +2284,7 @@ impl Player {
2236 ///2284 ///
2237 /// Honest about what it does: the sound is *resampled*, so the pitch goes up2285 /// Honest about what it does: the sound is *resampled*, so the pitch goes up
2238 /// with the rate, which is what the tape in the title means.2286 /// with the rate, which is what the tape in the title means.
2239- pub(crate) fn speed_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {2287+ pub(crate) fn speed_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
2240 let (lane, idx) = self.speed_open?;2288 let (lane, idx) = self.speed_open?;
2241 let speed = self.card_speed();2289 let speed = self.card_speed();
2242 let session = self.session.as_ref()?;2290 let session = self.session.as_ref()?;
@@ -2290,6 +2338,7 @@ impl Player {
2290 .justify_center()2338 .justify_center()
2291 .items_center()2339 .items_center()
2292 .bg(rgba(SCRIM()))2340 .bg(rgba(SCRIM()))
2341+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
2293 // Click away closes it, as on every card here.2342 // Click away closes it, as on every card here.
2294 .on_mouse_down(2343 .on_mouse_down(
2295 MouseButton::Left,2344 MouseButton::Left,
@@ -2302,7 +2351,7 @@ impl Player {
2302 .child(2351 .child(
2303 div()2352 div()
2304 .w_full()2353 .w_full()
2305- .max_w(px(COLOR_W))2354+ .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width))))
2306 .on_mouse_down(MouseButton::Left, swallow)2355 .on_mouse_down(MouseButton::Left, swallow)
2307 .flex()2356 .flex()
2308 .flex_col()2357 .flex_col()
@@ -2312,7 +2361,7 @@ impl Player {
2312 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2361 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2313 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2362 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2314 .when(dark, |d| {2363 .when(dark, |d| {
2315- d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()), Some(help_text.into())))2364+ d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx))
2316 })2365 })
2317 .when(!dark, |d| {2366 .when(!dark, |d| {
2318 d.child(div().flex_none().px(px(6.)).child(format!(2367 d.child(div().flex_none().px(px(6.)).child(format!(
@@ -2401,7 +2450,7 @@ impl Player {
2401 /// move it too. The rows scroll rather than the card growing past the2450 /// move it too. The rows scroll rather than the card growing past the
2402 /// window -- a timeline may hold more tracks than a 360 px window has room2451 /// window -- a timeline may hold more tracks than a 360 px window has room
2403 /// for faders.2452 /// for faders.
2404- pub(crate) fn mix_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {2453+ pub(crate) fn mix_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
2405 if !self.mix_open {2454 if !self.mix_open {
2406 return None;2455 return None;
2407 }2456 }
@@ -2523,6 +2572,7 @@ impl Player {
2523 .justify_center()2572 .justify_center()
2524 .items_center()2573 .items_center()
2525 .bg(rgba(SCRIM()))2574 .bg(rgba(SCRIM()))
2575+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
2526 // Click away closes it, as on every card here.2576 // Click away closes it, as on every card here.
2527 .on_mouse_down(2577 .on_mouse_down(
2528 MouseButton::Left,2578 MouseButton::Left,
@@ -2535,7 +2585,7 @@ impl Player {
2535 .child(2585 .child(
2536 div()2586 div()
2537 .w_full()2587 .w_full()
2538- .max_w(px(COLOR_W))2588+ .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width))))
2539 .on_mouse_down(MouseButton::Left, swallow)2589 .on_mouse_down(MouseButton::Left, swallow)
2540 .max_h(px(360. - 24.))2590 .max_h(px(360. - 24.))
2541 .flex()2591 .flex()
@@ -2545,7 +2595,7 @@ impl Player {
2545 .rounded(px(6.))2595 .rounded(px(6.))
2546 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2596 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2547 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2597 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2548- .when(dark, |d| d.child(dark_card_head("Mix", None, Some(help_text.into()))))2598+ .when(dark, |d| d.child(dark_card_head("Mix", None, Some(help_text.into()), Some(self.card_maximized), cx)))
2549 .when(!dark, |d| {2599 .when(!dark, |d| {
2550 d.child(2600 d.child(
2551 div()2601 div()
@@ -2598,7 +2648,7 @@ impl Player {
2598 /// card's shape for the same reason: app-global, kept in a file beside2648 /// card's shape for the same reason: app-global, kept in a file beside
2599 /// the theme, and drawn straight off `self.sub_text` / `self.sub_family`2649 /// the theme, and drawn straight off `self.sub_text` / `self.sub_family`
2600 /// so a change is on the cue underneath before the card is closed.2650 /// so a change is on the cue underneath before the card is closed.
2601- pub(crate) fn subtitle_style_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {2651+ pub(crate) fn subtitle_style_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
2602 if !self.subtitle_style_open {2652 if !self.subtitle_style_open {
2603 return None;2653 return None;
2604 }2654 }
@@ -2727,6 +2777,7 @@ impl Player {
2727 .justify_center()2777 .justify_center()
2728 .items_center()2778 .items_center()
2729 .bg(rgba(SCRIM()))2779 .bg(rgba(SCRIM()))
2780+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
2730 .on_mouse_down(2781 .on_mouse_down(
2731 MouseButton::Left,2782 MouseButton::Left,
2732 cx.listener(|this, _: &MouseDownEvent, _, cx| {2783 cx.listener(|this, _: &MouseDownEvent, _, cx| {
@@ -2738,7 +2789,7 @@ impl Player {
2738 .child(2789 .child(
2739 div()2790 div()
2740 .w_full()2791 .w_full()
2741- .max_w(px(COLOR_W))2792+ .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width))))
2742 .on_mouse_down(MouseButton::Left, swallow)2793 .on_mouse_down(MouseButton::Left, swallow)
2743 .max_h(px(360. - 24.))2794 .max_h(px(360. - 24.))
2744 .flex()2795 .flex()
@@ -2749,7 +2800,7 @@ impl Player {
2749 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2800 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2750 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2801 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2751 .when(dark, |d| {2802 .when(dark, |d| {
2752- d.child(dark_card_head("Subtitle style", None, Some(help_text.into())))2803+ d.child(dark_card_head("Subtitle style", None, Some(help_text.into()), Some(self.card_maximized), cx))
2753 })2804 })
2754 .when(!dark, |d| {2805 .when(!dark, |d| {
2755 d.child(2806 d.child(
@@ -2791,7 +2842,7 @@ impl Player {
2791 /// *about* the timeline -- the marks under it are the whole preview -- so2842 /// *about* the timeline -- the marks under it are the whole preview -- so
2792 /// the bed stays readable and the card sits up in the picture area rather2843 /// the bed stays readable and the card sits up in the picture area rather
2793 /// than over the lanes.2844 /// than over the lanes.
2794- pub(crate) fn silence_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {2845+ pub(crate) fn silence_card(&self, viewport: Size<Pixels>, cx: &mut Context<Self>) -> Option<impl IntoElement> {
2795 let (lane, idx) = self.silence_open?;2846 let (lane, idx) = self.silence_open?;
2796 let dark = self.darkroom;2847 let dark = self.darkroom;
2797 let cfg = self.silence;2848 let cfg = self.silence;
@@ -2971,6 +3022,7 @@ impl Player {
2971 // Light enough to read the lanes and the marks on them through:3022 // Light enough to read the lanes and the marks on them through:
2972 // the preview is the point of this card.3023 // the preview is the point of this card.
2973 .bg(rgba(SCRIM_LIGHT()))3024 .bg(rgba(SCRIM_LIGHT()))
3025+ .when(self.card_maximized, |d| d.top(px(crate::ui::stance::below_picture_floor(f32::from(viewport.height)))))
2974 // Click away closes it, as on every card here -- and the marks3026 // Click away closes it, as on every card here -- and the marks
2975 // go with it, which is what makes this one a call and not a flag.3027 // go with it, which is what makes this one a call and not a flag.
2976 .on_mouse_down(3028 .on_mouse_down(
@@ -2984,7 +3036,7 @@ impl Player {
2984 .child(3036 .child(
2985 div()3037 div()
2986 .w_full()3038 .w_full()
2987- .max_w(px(COLOR_W))3039+ .max_w(px(card_max_w(COLOR_W, self.card_maximized, f32::from(viewport.width))))
2988 .on_mouse_down(MouseButton::Left, swallow)3040 .on_mouse_down(MouseButton::Left, swallow)
2989 .flex()3041 .flex()
2990 .flex_col()3042 .flex_col()
@@ -2994,7 +3046,7 @@ impl Player {
2994 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))3046 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2995 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))3047 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2996 .when(dark, |d| {3048 .when(dark, |d| {
2997- d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into())))3049+ d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into()), Some(self.card_maximized), cx))
2998 })3050 })
2999 .when(!dark, |d| {3051 .when(!dark, |d| {
3000 d.child(div().flex_none().px(px(6.)).child(format!(3052 d.child(div().flex_none().px(px(6.)).child(format!(
crates/app/src/ui/dock_stance.rsmodified+33 -11
@@ -44,6 +44,28 @@ fn save(src_active: bool) {
44 let _ = std::fs::write(path, if src_active { "Src\n" } else { "Clip\n" });44 let _ = std::fs::write(path, if src_active { "Src\n" } else { "Clip\n" });
45 }45 }
46 46
47+/// Whether the room's one open param card is maximized -- the same
48+/// small-file round trip as the dock tab pick above, its own word beside it
49+/// ("a room reopens exactly as left", DESIGN.md:135), so a maximized EQ stays
50+/// maximized across a close and reopen of the whole room, not just the card.
51+pub(crate) fn maximized_config_path() -> std::path::PathBuf {
52+ crate::keymap::Keymap::config_path().with_file_name("card-maximized")
53+}
54+
55+pub(crate) fn load_maximized() -> bool {
56+ std::fs::read_to_string(maximized_config_path())
57+ .map(|text| text.trim() == "1")
58+ .unwrap_or(false)
59+}
60+
61+pub(crate) fn save_maximized(maximized: bool) {
62+ let path = maximized_config_path();
63+ if let Some(dir) = path.parent() {
64+ let _ = std::fs::create_dir_all(dir);
65+ }
66+ let _ = std::fs::write(path, if maximized { "1\n" } else { "0\n" });
67+}
68+
47 /// The Sources tab's four sort chips (MOCK-SPEC "Dock" §3). `Recent` is the69 /// The Sources tab's four sort chips (MOCK-SPEC "Dock" §3). `Recent` is the
48 /// library's own arrival order -- the only order this editor tracks without70 /// library's own arrival order -- the only order this editor tracks without
49 /// a fourth field to keep it in.71 /// a fourth field to keep it in.
@@ -502,8 +524,8 @@ fn sources_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
502 /// these onto. Drag-while-playing and every other gesture on a row is524 /// these onto. Drag-while-playing and every other gesture on a row is
503 /// whatever that card already does; nothing about the gesture is reimplemented525 /// whatever that card already does; nothing about the gesture is reimplemented
504 /// here.526 /// here.
505-fn clip_tab(player: &Player, width: f32, window_h: Pixels, cx: &mut Context<Player>) -> impl IntoElement {527+fn clip_tab(player: &Player, width: f32, window_size: Size<Pixels>, cx: &mut Context<Player>) -> impl IntoElement {
506- let room = size(px(width), window_h);528+ let _ = width;
507 let none_open = player.eq_open.is_none()529 let none_open = player.eq_open.is_none()
508 && player.color_open.is_none()530 && player.color_open.is_none()
509 && player.transform_open.is_none()531 && player.transform_open.is_none()
@@ -596,19 +618,19 @@ fn clip_tab(player: &Player, width: f32, window_h: Pixels, cx: &mut Context<Play
596 .min_h(px(0.))618 .min_h(px(0.))
597 .px(px(8.))619 .px(px(8.))
598 .pb(px(8.))620 .pb(px(8.))
599- .children(player.eq_card(room, cx))621+ .children(player.eq_card(window_size, cx))
600- .children(player.color_card(cx))622+ .children(player.color_card(window_size, cx))
601- .children(player.transform_card(cx))623+ .children(player.transform_card(window_size, cx))
602- .children(player.speed_card(cx))624+ .children(player.speed_card(window_size, cx))
603- .children(player.silence_card(cx))625+ .children(player.silence_card(window_size, cx))
604- .children(player.mix_card(cx))626+ .children(player.mix_card(window_size, cx))
605 // Subtitle style has no verb row of its own here (see the627 // Subtitle style has no verb row of its own here (see the
606 // comment above the ghost verbs) but its card still has to628 // comment above the ghost verbs) but its card still has to
607 // be mounted somewhere in the darkroom or its chord (`y`)629 // be mounted somewhere in the darkroom or its chord (`y`)
608 // opens an invisible modal (GAP 2) -- this is that mount,630 // opens an invisible modal (GAP 2) -- this is that mount,
609 // painted in the Clip tab like the six cards beside it until631 // painted in the Clip tab like the six cards beside it until
610 // the subtitle lane grows the header that is its real home.632 // the subtitle lane grows the header that is its real home.
611- .children(player.subtitle_style_card(cx))633+ .children(player.subtitle_style_card(window_size, cx))
612 // A plate, not bare space: DESIGN §11's "states" checklist --634 // A plate, not bare space: DESIGN §11's "states" checklist --
613 // nothing picked reads as a hint, not as a hole in the panel.635 // nothing picked reads as a hint, not as a hole in the panel.
614 .when(none_open, |d| {636 .when(none_open, |d| {
@@ -638,7 +660,7 @@ fn clip_tab(player: &Player, width: f32, window_h: Pixels, cx: &mut Context<Play
638 /// pair). What degrades *inside* fixed width is the two tabs' own content:660 /// pair). What degrades *inside* fixed width is the two tabs' own content:
639 /// Sources scrolls its own row list; Clip's param rows are whatever their661 /// Sources scrolls its own row list; Clip's param rows are whatever their
640 /// card already draws at this width.662 /// card already draws at this width.
641-pub(crate) fn render(player: &Player, width: f32, window_h: Pixels, cx: &mut Context<Player>) -> impl IntoElement {663+pub(crate) fn render(player: &Player, width: f32, window_size: Size<Pixels>, cx: &mut Context<Player>) -> impl IntoElement {
642 let src_active = player.dock_src_active;664 let src_active = player.dock_src_active;
643 div()665 div()
644 .id("stance-dock-body")666 .id("stance-dock-body")
@@ -660,6 +682,6 @@ pub(crate) fn render(player: &Player, width: f32, window_h: Pixels, cx: &mut Con
660 )682 )
661 .child(match src_active {683 .child(match src_active {
662 true => sources_tab(player, cx).into_any_element(),684 true => sources_tab(player, cx).into_any_element(),
663- false => clip_tab(player, width, window_h, cx).into_any_element(),685+ false => clip_tab(player, width, window_size, cx).into_any_element(),
664 })686 })
665 }687 }
crates/app/src/ui/stance.rsmodified+3 -3
@@ -567,7 +567,7 @@ fn ledger(player: &Player, position: f64) -> impl IntoElement {
567 /// The dock: the only side panel, right, fixed width, carrying the Src/Clip567 /// The dock: the only side panel, right, fixed width, carrying the Src/Clip
568 /// tab pair (DESIGN §5). The frame is drawn here; `dock_stance.rs` owns the568 /// tab pair (DESIGN §5). The frame is drawn here; `dock_stance.rs` owns the
569 /// tab row and both tabs' content (DESIGN §12 step 4).569 /// tab row and both tabs' content (DESIGN §12 step 4).
570-fn dock(player: &Player, window_h: Pixels, cx: &mut Context<Player>) -> impl IntoElement {570+fn dock(player: &Player, window_size: Size<Pixels>, cx: &mut Context<Player>) -> impl IntoElement {
571 div()571 div()
572 .id("stance-dock")572 .id("stance-dock")
573 .flex_none()573 .flex_none()
@@ -578,7 +578,7 @@ fn dock(player: &Player, window_h: Pixels, cx: &mut Context<Player>) -> impl Int
578 .border_color(rgba(DARK_SEAM()))578 .border_color(rgba(DARK_SEAM()))
579 .flex()579 .flex()
580 .flex_col()580 .flex_col()
581- .child(dock_stance::render(player, DOCK_W, window_h, cx))581+ .child(dock_stance::render(player, DOCK_W, window_size, cx))
582 }582 }
583 583
584 /// The whole stance: spine, screen, time band, bench, ledger, dock, in the584 /// The whole stance: spine, screen, time band, bench, ledger, dock, in the
@@ -780,5 +780,5 @@ pub(crate) fn render(
780 .children(player.export_progress_card(cx))780 .children(player.export_progress_card(cx))
781 .children(player.picker_card(window_size, cx)),781 .children(player.picker_card(window_size, cx)),
782 )782 )
783- .child(dock(player, window_h, cx))783+ .child(dock(player, window_size, cx))
784 }784 }