forge
Explore
Log in

Don't you dare go Hollow

The menus and the cards join the room

Browse files at this commit

d57e5d13b3dddf3e0978a7ef7f57c194fbf0def8Ahmet Kaan GümüşParent: b97144e
  • style
    • the menus and the cards join the room
Show full message
💄 style(ui): the menus and the cards join the room

The colour card and the keymap menu both broke the
rules. They did, and not only those two — the whole card and menu class was
still speaking the old app's language.

The menus had no type at all: raw toolkit text at whatever size it defaults
to, chords in the same face as the verbs. Rows are Archivo now and every
chord is mono, because a chord is something the film answers to. They also
opened wherever the pointer was, which meant over the picture; they clamp
below it now, the way the export plate and the preview already do.

The param cards were legacy sheets: a seventeen-pixel title in a language
whose largest type is thirteen, labels sitting on filled pills, values in
the room's voice rather than the film's, and a filled Reset box beside an
r that already resets. Colour, transform, speed and mix wear the language
now — heads at nine, rows at ten and a half, values in mono, the picked row
marked by a rule rather than a fill, and the resets are ghosts.

Silence, subtitle style and the EQ still carry the old dress; the shared
pieces they need are in place for the pass that follows.
crates/app/src/ui/cards.rsmodified+435 -186
@@ -4,6 +4,133 @@ use crate::*;
44 use crate::ui::type_scale::{self, Typeset};
55 use crate::ui::widgets::*;
66
7+/// DESIGN §3/§4 atoms shared by every param/setting card below (colour,
8+/// transform, speed, EQ, silence, mix, subtitle style): what a row's label
9+/// and value paint as once `self.darkroom` is on, so the seven card bodies
10+/// each pick tokens rather than reimplement the same font/colour swap seven
11+/// times (`export_card`'s own `dark`-branch technique, one level up).
12+///
13+/// A row label is what the room says about the control -- Archivo, §3's
14+/// 10.5px row size, `ink2` at rest / `ink1` picked (no permanent pill: the
15+/// picked state is a 1px `ink1` rule, §4's focus ring, not a fill).
16+fn dark_row_label(text: impl Into<SharedString>, picked: bool) -> Div {
17+ div()
18+ .type_style(type_scale::label(type_scale::LABEL_ROW_PX, gpui::FontWeight::MEDIUM))
19+ .text_color(rgb(if picked { INK1() } else { INK2() }))
20+ .child(text.into())
21+}
22+
23+/// A row's value -- what the film/the setting *says*, mono per §3.
24+fn dark_row_value(text: impl Into<SharedString>) -> Div {
25+ div()
26+ .type_style(type_scale::mono(type_scale::LABEL_ROW_PX, gpui::FontWeight::MEDIUM))
27+ .text_color(rgb(INK1()))
28+ .child(text.into())
29+}
30+
31+/// A card's own head line: the verb in Archivo (§3 section-head casing) and,
32+/// where there is one, the clip it names in mono beside it -- "which clip"
33+/// is metadata about the footage, not the room's own voice.
34+fn dark_card_head(verb: &str, meta: Option<SharedString>) -> Div {
35+ div()
36+ .flex_none()
37+ .px(px(6.))
38+ .flex()
39+ .items_baseline()
40+ .gap(px(6.))
41+ .child(
42+ div()
43+ .type_style(type_scale::head())
44+ .text_color(rgb(INK3()))
45+ .child(verb.to_uppercase()),
46+ )
47+ .children(meta.map(|m| {
48+ div()
49+ .type_style(type_scale::mono(type_scale::CHORD_METADATA_MAX_PX, gpui::FontWeight::MEDIUM))
50+ .text_color(rgb(INK3()))
51+ .child(m)
52+ }))
53+}
54+
55+/// The help/status line under a card's head: what the keys do, which is
56+/// metadata about the room's controls -- mono, §3.
57+fn dark_help(text: impl Into<SharedString>) -> Div {
58+ div()
59+ .flex_none()
60+ .px(px(6.))
61+ .type_style(type_scale::mono(type_scale::LABEL_ROW_PX, gpui::FontWeight::MEDIUM))
62+ .text_color(rgb(INK3()))
63+ .child(text.into())
64+}
65+
66+/// A ghost action row (DESIGN §4): borderless label + its chord, never a
67+/// filled box -- the shape every card's Reset/Flatten/Add/Remove/toggle
68+/// button takes now that "boxes are commitments" and Export is the one box
69+/// in the room. `active` is a toggle's own held-on state (EQ's spectrum
70+/// switch), not hover -- it keeps the fill and brightens the ink the same
71+/// way a picked param row's ring does.
72+/// The mix/silence/subtitle-size shape's own nudge glyph: ghost, not the
73+/// filled pill it used to be a permanent box -- resting bare, one fill step
74+/// on hover/press, same grammar as [`dark_ghost_button`] at a stepper's size.
75+fn dark_step_glyph(
76+ id: impl Into<gpui::ElementId>,
77+ plus: bool,
78+ on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
79+) -> impl IntoElement {
80+ div()
81+ .id(id.into())
82+ .flex_none()
83+ .w(px(HIT_MIN))
84+ .h(px(KEYS_ROW_H))
85+ .flex()
86+ .items_center()
87+ .justify_center()
88+ .rounded(px(3.))
89+ .cursor_pointer()
90+ .hover(|s| s.bg(rgb(DARK_RAISED())))
91+ .on_click(on_click)
92+ .child(dark_row_value(if plus { "+" } else { "−" }))
93+}
94+
95+fn dark_ghost_button(
96+ id: impl Into<gpui::ElementId>,
97+ text: impl Into<SharedString>,
98+ chord: &str,
99+ active: bool,
100+ on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
101+) -> impl IntoElement {
102+ div()
103+ .id(id.into())
104+ .flex_1()
105+ .flex()
106+ .h(px(CONTROL_H))
107+ .items_center()
108+ .justify_center()
109+ .gap(px(6.))
110+ .rounded(px(3.))
111+ .when(active, |d| d.bg(rgb(DARK_RAISED())))
112+ .cursor_pointer()
113+ .hover(|s| s.bg(rgb(DARK_RAISED())))
114+ .on_click(on_click)
115+ .child(
116+ div()
117+ .type_style(type_scale::label(type_scale::LABEL_ROW_PX, gpui::FontWeight::MEDIUM))
118+ .text_color(rgb(if active { INK1() } else { INK2() }))
119+ .child(text.into()),
120+ )
121+ .when(!chord.is_empty(), |d| {
122+ d.child(
123+ div()
124+ .type_style(type_scale::mono(
125+ type_scale::CHORD_METADATA_MIN_PX,
126+ gpui::FontWeight::MEDIUM,
127+ ))
128+ .text_color(rgb(INK3()))
129+ .child(chord.to_string()),
130+ )
131+ })
132+}
133+
7134 impl Player {
8135 /// What an export is going to be, before there is one: the codec, the box
9136 /// it goes into, the bitrate, where it lands -- and, above the button, the
@@ -1555,6 +1682,7 @@ impl Player {
15551682 pub(crate) fn color_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {
15561683 let (lane, idx) = self.color_open?;
15571684 let params = self.color_params();
1685+ let dark = self.darkroom;
15581686 let rows: Vec<_> = COLOR_BANDS
15591687 .iter()
15601688 .enumerate()
@@ -1572,13 +1700,24 @@ impl Player {
15721700 .px(px(6.))
15731701 .rounded(px(3.))
15741702 .cursor_pointer()
1575- .when(picked, |d| d.bg(rgb(BG_SELECTED())))
1576- .hover(|s| s.bg(rgb(BG_HOVER())))
1703+ // Darkroom: no permanent pill under a label -- the picked
1704+ // row is a 1px `ink1` rule (§4's focus ring), never a fill.
1705+ // Hover is the one fill step §4 allows.
1706+ .when(dark && picked, |d| d.border_l_2().border_color(rgb(INK1())))
1707+ .when(!dark && picked, |d| d.bg(rgb(BG_SELECTED())))
1708+ .hover(|s| s.bg(rgb(if dark { DARK_RAISED() } else { BG_HOVER() })))
15771709 .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
15781710 this.color_band = i;
15791711 cx.notify();
15801712 }))
1581- .child(div().flex_1().min_w(px(0.)).truncate().child(label))
1713+ .child(
1714+ div()
1715+ .flex_1()
1716+ .min_w(px(0.))
1717+ .truncate()
1718+ .when(dark, |d| d.child(dark_row_label(label, picked)))
1719+ .when(!dark, |d| d.child(label)),
1720+ )
15821721 .child(
15831722 // The bar is 4 px to look at and a whole row to hit
15841723 // (WCAG 2.5.8), the same split the ruler makes between
@@ -1608,7 +1747,7 @@ impl Player {
16081747 .w_full()
16091748 .h(px(4.))
16101749 .rounded(px(2.))
1611- .bg(rgb(BG_PANEL()))
1750+ .bg(rgb(if dark { DARK_PANEL() } else { BG_PANEL() }))
16121751 .child(
16131752 div()
16141753 .h_full()
@@ -1621,12 +1760,18 @@ impl Player {
16211760 .child(
16221761 div()
16231762 .w(px(44.))
1624- .text_size(px(11.))
1625- .text_color(rgb(FG_SECONDARY()))
1626- .child(format!("{value:.2}")),
1763+ .when(dark, |d| d.child(dark_row_value(format!("{value:.2}"))))
1764+ .when(!dark, |d| {
1765+ d.text_size(px(11.))
1766+ .text_color(rgb(FG_SECONDARY()))
1767+ .child(format!("{value:.2}"))
1768+ }),
16271769 )
16281770 })
16291771 .collect();
1772+ let head_meta: SharedString = format!("{} clip {}", lane.label(), idx + 1).into();
1773+ let help_text =
1774+ "drag a bar, or ↑↓ picks one and ←→ moves it, r resets — a click away or esc closes";
16301775 Some(
16311776 drag_scrim(cx)
16321777 .flex()
@@ -1652,22 +1797,27 @@ impl Player {
16521797 .gap(px(2.))
16531798 .p(px(12.))
16541799 .rounded(px(6.))
1655- .bg(rgb(BG_RAISED()))
1656- .child(div().flex_none().px(px(6.)).child(format!(
1657- "Colour — {} clip {}",
1658- lane.label(),
1659- idx + 1
1660- )))
1661- .child(
1662- div()
1663- .flex_none()
1664- .px(px(6.))
1665- .text_size(px(11.))
1666- .text_color(rgb(FG_SECONDARY()))
1667- .child(
1668- "drag a bar, or ↑↓ picks one and ←→ moves it, r resets — a click away or esc closes",
1669- ),
1670- )
1800+ .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1801+ .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1802+ .when(dark, |d| d.child(dark_card_head("Colour", Some(head_meta.clone()))))
1803+ .when(!dark, |d| {
1804+ d.child(div().flex_none().px(px(6.)).child(format!(
1805+ "Colour — {} clip {}",
1806+ lane.label(),
1807+ idx + 1
1808+ )))
1809+ })
1810+ .when(dark, |d| d.child(dark_help(help_text)))
1811+ .when(!dark, |d| {
1812+ d.child(
1813+ div()
1814+ .flex_none()
1815+ .px(px(6.))
1816+ .text_size(px(11.))
1817+ .text_color(rgb(FG_SECONDARY()))
1818+ .child(help_text),
1819+ )
1820+ })
16711821 // The frame as it is being graded, over the controls
16721822 // grading it: the three lines are what the picture is
16731823 // made of, and every sample of a drag reseeks, so they
@@ -1677,28 +1827,41 @@ impl Player {
16771827 .flex_none()
16781828 .h(px(HIST_H))
16791829 .rounded(px(3.))
1680- .bg(rgb(BG_HOVER_DIM()))
1830+ .bg(rgb(if dark { DARK_HAIRLINE() } else { BG_HOVER_DIM() }))
16811831 .relative()
16821832 .child(hist_curves(self.histogram)),
16831833 )
16841834 .children(rows)
1685- .child(
1686- div()
1687- .id("color-reset")
1688- .mt(px(4.))
1689- .flex()
1690- .h(px(CONTROL_H))
1691- .items_center()
1692- .justify_center()
1693- .rounded(px(3.))
1694- .bg(rgb(BG_SELECTED()))
1695- .cursor_pointer()
1696- .hover(|s| s.bg(rgb(BG_HOVER())))
1697- .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
1835+ .when(dark, |d| {
1836+ d.child(dark_ghost_button(
1837+ "color-reset",
1838+ "Reset",
1839+ "r",
1840+ false,
1841+ cx.listener(|this, _: &ClickEvent, _, cx| {
16981842 this.set_color(ColorParams::default(), cx);
1699- }))
1700- .child("Reset"),
1701- ),
1843+ }),
1844+ ))
1845+ })
1846+ .when(!dark, |d| {
1847+ d.child(
1848+ div()
1849+ .id("color-reset")
1850+ .mt(px(4.))
1851+ .flex()
1852+ .h(px(CONTROL_H))
1853+ .items_center()
1854+ .justify_center()
1855+ .rounded(px(3.))
1856+ .bg(rgb(BG_SELECTED()))
1857+ .cursor_pointer()
1858+ .hover(|s| s.bg(rgb(BG_HOVER())))
1859+ .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
1860+ this.set_color(ColorParams::default(), cx);
1861+ }))
1862+ .child("Reset"),
1863+ )
1864+ }),
17021865 ),
17031866 )
17041867 }
@@ -1709,6 +1872,7 @@ impl Player {
17091872 pub(crate) fn transform_card(&self, cx: &mut Context<Self>) -> Option<impl IntoElement> {
17101873 let (lane, idx) = self.transform_open?;
17111874 let params = self.transform_params();
1875+ let dark = self.darkroom;
17121876 let rows: Vec<_> = TRANSFORM_BANDS
17131877 .iter()
17141878 .enumerate()
@@ -1726,13 +1890,21 @@ impl Player {
17261890 .px(px(6.))
17271891 .rounded(px(3.))
17281892 .cursor_pointer()
1729- .when(picked, |d| d.bg(rgb(BG_SELECTED())))
1730- .hover(|s| s.bg(rgb(BG_HOVER())))
1893+ .when(dark && picked, |d| d.border_l_2().border_color(rgb(INK1())))
1894+ .when(!dark && picked, |d| d.bg(rgb(BG_SELECTED())))
1895+ .hover(|s| s.bg(rgb(if dark { DARK_RAISED() } else { BG_HOVER() })))
17311896 .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
17321897 this.transform_band = i;
17331898 cx.notify();
17341899 }))
1735- .child(div().flex_1().min_w(px(0.)).truncate().child(label))
1900+ .child(
1901+ div()
1902+ .flex_1()
1903+ .min_w(px(0.))
1904+ .truncate()
1905+ .when(dark, |d| d.child(dark_row_label(label, picked)))
1906+ .when(!dark, |d| d.child(label)),
1907+ )
17361908 .child(
17371909 div()
17381910 .id(("transform-bar", i))
@@ -1757,7 +1929,7 @@ impl Player {
17571929 .w_full()
17581930 .h(px(4.))
17591931 .rounded(px(2.))
1760- .bg(rgb(BG_PANEL()))
1932+ .bg(rgb(if dark { DARK_PANEL() } else { BG_PANEL() }))
17611933 .child(
17621934 div()
17631935 .h_full()
@@ -1768,17 +1940,25 @@ impl Player {
17681940 ),
17691941 )
17701942 .child(
1771- div()
1772- .w(px(44.))
1773- .text_size(px(11.))
1774- .text_color(rgb(FG_SECONDARY()))
1775- .child(match i == ROTATE_BAND {
1943+ div().w(px(44.)).when(dark, |d| {
1944+ d.child(dark_row_value(match i == ROTATE_BAND {
17761945 true => format!("{value:.0}°"),
17771946 false => format!("{value:.2}"),
1778- }),
1947+ }))
1948+ }).when(!dark, |d| {
1949+ d.text_size(px(11.))
1950+ .text_color(rgb(FG_SECONDARY()))
1951+ .child(match i == ROTATE_BAND {
1952+ true => format!("{value:.0}°"),
1953+ false => format!("{value:.2}"),
1954+ })
1955+ }),
17791956 )
17801957 })
17811958 .collect();
1959+ let head_meta: SharedString = format!("{} clip {}", lane.label(), idx + 1).into();
1960+ let help_text = "drag a bar, or ↑↓ picks one and ←→ moves it (rotation steps \
1961+ by 90°), r resets — a click away or esc closes";
17821962 Some(
17831963 drag_scrim(cx)
17841964 .flex()
@@ -1803,41 +1983,58 @@ impl Player {
18031983 .gap(px(2.))
18041984 .p(px(12.))
18051985 .rounded(px(6.))
1806- .bg(rgb(BG_RAISED()))
1807- .child(div().flex_none().px(px(6.)).child(format!(
1808- "Transform — {} clip {}",
1809- lane.label(),
1810- idx + 1
1811- )))
1812- .child(
1813- div()
1814- .flex_none()
1815- .px(px(6.))
1816- .text_size(px(11.))
1817- .text_color(rgb(FG_SECONDARY()))
1818- .child(
1819- "drag a bar, or ↑↓ picks one and ←→ moves it (rotation steps \
1820- by 90°), r resets — a click away or esc closes",
1821- ),
1822- )
1986+ .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1987+ .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1988+ .when(dark, |d| d.child(dark_card_head("Transform", Some(head_meta.clone()))))
1989+ .when(!dark, |d| {
1990+ d.child(div().flex_none().px(px(6.)).child(format!(
1991+ "Transform — {} clip {}",
1992+ lane.label(),
1993+ idx + 1
1994+ )))
1995+ })
1996+ .when(dark, |d| d.child(dark_help(help_text)))
1997+ .when(!dark, |d| {
1998+ d.child(
1999+ div()
2000+ .flex_none()
2001+ .px(px(6.))
2002+ .text_size(px(11.))
2003+ .text_color(rgb(FG_SECONDARY()))
2004+ .child(help_text),
2005+ )
2006+ })
18232007 .children(rows)
1824- .child(
1825- div()
1826- .id("transform-reset")
1827- .mt(px(4.))
1828- .flex()
1829- .h(px(CONTROL_H))
1830- .items_center()
1831- .justify_center()
1832- .rounded(px(3.))
1833- .bg(rgb(BG_SELECTED()))
1834- .cursor_pointer()
1835- .hover(|s| s.bg(rgb(BG_HOVER())))
1836- .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
2008+ .when(dark, |d| {
2009+ d.child(dark_ghost_button(
2010+ "transform-reset",
2011+ "Reset",
2012+ "r",
2013+ false,
2014+ cx.listener(|this, _: &ClickEvent, _, cx| {
18372015 this.set_transform(TransformParams::default(), cx);
1838- }))
1839- .child("Reset"),
1840- ),
2016+ }),
2017+ ))
2018+ })
2019+ .when(!dark, |d| {
2020+ d.child(
2021+ div()
2022+ .id("transform-reset")
2023+ .mt(px(4.))
2024+ .flex()
2025+ .h(px(CONTROL_H))
2026+ .items_center()
2027+ .justify_center()
2028+ .rounded(px(3.))
2029+ .bg(rgb(BG_SELECTED()))
2030+ .cursor_pointer()
2031+ .hover(|s| s.bg(rgb(BG_HOVER())))
2032+ .on_click(cx.listener(|this, _: &ClickEvent, _, cx| {
2033+ this.set_transform(TransformParams::default(), cx);
2034+ }))
2035+ .child("Reset"),
2036+ )
2037+ }),
18412038 ),
18422039 )
18432040 }
@@ -1856,6 +2053,7 @@ impl Player {
18562053 let speed = self.card_speed();
18572054 let session = self.session.as_ref()?;
18582055 let clip = session.lane_clips(lane).get(idx).copied()?;
2056+ let dark = self.darkroom;
18592057 let lo = f32::from(Speed::MIN.permille());
18602058 let hi = f32::from(Speed::MAX.permille());
18612059 let frac = ((f32::from(speed.permille()) - lo) / (hi - lo)).clamp(0., 1.);
@@ -1863,6 +2061,7 @@ impl Player {
18632061 .into_iter()
18642062 .map(|permille| {
18652063 let at = Speed::from_permille(permille);
2064+ let picked = at == speed;
18662065 div()
18672066 .id(("speed-preset", usize::from(permille)))
18682067 .flex_1()
@@ -1871,18 +2070,32 @@ impl Player {
18712070 .items_center()
18722071 .justify_center()
18732072 .rounded(px(3.))
1874- .bg(rgb(match at == speed {
1875- true => BG_SELECTED(),
1876- false => BG_PANEL(),
1877- }))
2073+ .when(dark && picked, |d| d.bg(rgb(DARK_RAISED())))
2074+ .when(!dark, |d| {
2075+ d.bg(rgb(match picked {
2076+ true => BG_SELECTED(),
2077+ false => BG_PANEL(),
2078+ }))
2079+ })
18782080 .cursor_pointer()
1879- .hover(|s| s.bg(rgb(BG_HOVER())))
2081+ .hover(|s| s.bg(rgb(if dark { DARK_RAISED() } else { BG_HOVER() })))
18802082 .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
18812083 this.set_speed(at, cx);
18822084 }))
1883- .child(format!("{at}"))
2085+ .when(dark, |d| d.child(dark_row_value(format!("{at}"))))
2086+ .when(!dark, |d| d.child(format!("{at}")))
18842087 })
18852088 .collect();
2089+ let head_meta: SharedString = format!("{} clip {}", lane.label(), idx + 1).into();
2090+ let help_text =
2091+ "drag the bar or ←→ moves it, r is 1.00x — the pitch moves with the rate; a click away or esc closes";
2092+ let tail_text: SharedString = format!(
2093+ "{speed} — {} source frames over {} on the timeline ({})",
2094+ clip.len(),
2095+ clip.frames(),
2096+ frames_timecode(clip.frames(), self.fps)
2097+ )
2098+ .into();
18862099 Some(
18872100 drag_scrim(cx)
18882101 .flex()
@@ -1908,22 +2121,27 @@ impl Player {
19082121 .gap(px(6.))
19092122 .p(px(12.))
19102123 .rounded(px(6.))
1911- .bg(rgb(BG_RAISED()))
1912- .child(div().flex_none().px(px(6.)).child(format!(
1913- "Speed (tape) — {} clip {}",
1914- lane.label(),
1915- idx + 1
1916- )))
1917- .child(
1918- div()
1919- .flex_none()
1920- .px(px(6.))
1921- .text_size(px(11.))
1922- .text_color(rgb(FG_SECONDARY()))
1923- .child(
1924- "drag the bar or ←→ moves it, r is 1.00x — the pitch moves with the rate; a click away or esc closes",
1925- ),
1926- )
2124+ .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2125+ .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2126+ .when(dark, |d| d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()))))
2127+ .when(!dark, |d| {
2128+ d.child(div().flex_none().px(px(6.)).child(format!(
2129+ "Speed (tape) — {} clip {}",
2130+ lane.label(),
2131+ idx + 1
2132+ )))
2133+ })
2134+ .when(dark, |d| d.child(dark_help(help_text)))
2135+ .when(!dark, |d| {
2136+ d.child(
2137+ div()
2138+ .flex_none()
2139+ .px(px(6.))
2140+ .text_size(px(11.))
2141+ .text_color(rgb(FG_SECONDARY()))
2142+ .child(help_text),
2143+ )
2144+ })
19272145 .child(
19282146 // 4 px to look at and a whole row to hit (WCAG
19292147 // 2.5.8), the split the colour sliders and the ruler
@@ -1949,7 +2167,7 @@ impl Player {
19492167 .w_full()
19502168 .h(px(4.))
19512169 .rounded(px(2.))
1952- .bg(rgb(BG_PANEL()))
2170+ .bg(rgb(if dark { DARK_PANEL() } else { BG_PANEL() }))
19532171 .child(
19542172 div()
19552173 .h_full()
@@ -1960,22 +2178,20 @@ impl Player {
19602178 ),
19612179 )
19622180 .child(div().flex().gap(px(4.)).children(presets))
1963- .child(
1964- div()
1965- .flex_none()
1966- .px(px(6.))
1967- .text_size(px(11.))
1968- .text_color(rgb(FG_SECONDARY()))
1969- // What the choice *is*, in the numbers the
1970- // timeline is measured in: the source range
1971- // never moves, the room it takes does.
1972- .child(format!(
1973- "{speed} — {} source frames over {} on the timeline ({})",
1974- clip.len(),
1975- clip.frames(),
1976- frames_timecode(clip.frames(), self.fps)
1977- )),
1978- ),
2181+ .when(dark, |d| d.child(dark_help(tail_text.clone())))
2182+ .when(!dark, |d| {
2183+ d.child(
2184+ div()
2185+ .flex_none()
2186+ .px(px(6.))
2187+ .text_size(px(11.))
2188+ .text_color(rgb(FG_SECONDARY()))
2189+ // What the choice *is*, in the numbers the
2190+ // timeline is measured in: the source range
2191+ // never moves, the room it takes does.
2192+ .child(tail_text),
2193+ )
2194+ }),
19792195 ),
19802196 )
19812197 }
@@ -2000,6 +2216,7 @@ impl Player {
20002216 if !self.mix_open {
20012217 return None;
20022218 }
2219+ let dark = self.darkroom;
20032220 let session = self.session.as_ref();
20042221 let lanes = self.mix_lanes();
20052222 let limiter = session.map_or_else(Limiter::default, PlaybackSession::limiter);
@@ -2027,6 +2244,7 @@ impl Player {
20272244 .into_iter()
20282245 .enumerate()
20292246 .map(|(n, (label, value))| {
2247+ let picked = n == self.mix_field;
20302248 div()
20312249 .id(("mix-row", n))
20322250 .flex()
@@ -2036,51 +2254,80 @@ impl Player {
20362254 .justify_between()
20372255 .px(px(6.))
20382256 .rounded(px(3.))
2039- .bg(rgb(match n == self.mix_field {
2040- true => BG_SELECTED(),
2041- false => BG_PANEL(),
2042- }))
2257+ .when(dark && picked, |d| d.border_l_2().border_color(rgb(INK1())))
2258+ .when(!dark, |d| {
2259+ d.bg(rgb(match picked {
2260+ true => BG_SELECTED(),
2261+ false => BG_PANEL(),
2262+ }))
2263+ })
20432264 .cursor_pointer()
2044- .hover(|s| s.bg(rgb(BG_HOVER())))
2265+ .hover(|s| s.bg(rgb(if dark { DARK_RAISED() } else { BG_HOVER() })))
20452266 .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
20462267 this.mix_field = n;
20472268 cx.notify();
20482269 }))
2049- .child(div().text_color(rgb(FG_SECONDARY())).child(label))
2270+ .child(
2271+ div()
2272+ .when(dark, |d| d.child(dark_row_label(label.clone(), picked)))
2273+ .when(!dark, |d| d.text_color(rgb(FG_SECONDARY())).child(label)),
2274+ )
20502275 .child(
20512276 div()
20522277 .flex()
20532278 .items_center()
20542279 .gap(px(4.))
2055- .child(value)
2280+ .when(dark, |d| d.child(dark_row_value(value.clone())))
2281+ .when(!dark, |d| d.child(value))
20562282 .children([-1, 1].map(|steps: i32| {
2057- div()
2058- .id(("mix-step", n * 2 + usize::from(steps > 0)))
2059- .flex_none()
2060- .w(px(HIT_MIN))
2061- .h(px(KEYS_ROW_H))
2062- .flex()
2063- .items_center()
2064- .justify_center()
2065- .rounded(px(3.))
2066- .bg(rgb(BG_PANEL()))
2067- .cursor_pointer()
2068- .hover(|s| s.bg(rgb(BG_HOVER())))
2069- .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
2070- // Picked as well as moved, the silence
2071- // card's rule: the row a press lands on
2072- // is the row the arrows carry on from.
2073- this.mix_field = n;
2074- this.nudge_mix(steps, cx);
2075- }))
2076- .child(match steps > 0 {
2077- true => "+",
2078- false => "−",
2079- })
2283+ let id = ("mix-step", n * 2 + usize::from(steps > 0));
2284+ match dark {
2285+ true => dark_step_glyph(
2286+ id,
2287+ steps > 0,
2288+ cx.listener(move |this, _: &ClickEvent, _, cx| {
2289+ this.mix_field = n;
2290+ this.nudge_mix(steps, cx);
2291+ }),
2292+ )
2293+ .into_any_element(),
2294+ false => div()
2295+ .id(id)
2296+ .flex_none()
2297+ .w(px(HIT_MIN))
2298+ .h(px(KEYS_ROW_H))
2299+ .flex()
2300+ .items_center()
2301+ .justify_center()
2302+ .rounded(px(3.))
2303+ .bg(rgb(BG_PANEL()))
2304+ .cursor_pointer()
2305+ .hover(|s| s.bg(rgb(BG_HOVER())))
2306+ .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
2307+ // Picked as well as moved, the silence
2308+ // card's rule: the row a press lands on
2309+ // is the row the arrows carry on from.
2310+ this.mix_field = n;
2311+ this.nudge_mix(steps, cx);
2312+ }))
2313+ .child(match steps > 0 {
2314+ true => "+",
2315+ false => "−",
2316+ })
2317+ .into_any_element(),
2318+ }
20802319 })),
20812320 )
20822321 })
20832322 .collect();
2323+ let help_text = "− and + move a setting, or ↑↓ picks one and ←→ moves it (hold to run it) — a track fader moves everything on that track; a click away or esc closes";
2324+ let tail_text = match limiter.on {
2325+ true => format!(
2326+ "the mix is held under {:+.0} dBFS — quieter passages are untouched",
2327+ limiter.ceiling_db
2328+ ),
2329+ false => "the limiter is out of circuit — a hot mix clips at full scale".to_string(),
2330+ };
20842331 Some(
20852332 scrim()
20862333 .flex()
@@ -2107,23 +2354,28 @@ impl Player {
21072354 .gap(px(6.))
21082355 .p(px(12.))
21092356 .rounded(px(6.))
2110- .bg(rgb(BG_RAISED()))
2111- .child(
2112- div()
2113- .flex_none()
2114- .px(px(6.))
2115- .child("Mix — track volumes and the master limiter"),
2116- )
2117- .child(
2118- div()
2119- .flex_none()
2120- .px(px(6.))
2121- .text_size(px(11.))
2122- .text_color(rgb(FG_SECONDARY()))
2123- .child(
2124- "− and + move a setting, or ↑↓ picks one and ←→ moves it (hold to run it) — a track fader moves everything on that track; a click away or esc closes",
2125- ),
2126- )
2357+ .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2358+ .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2359+ .when(dark, |d| d.child(dark_card_head("Mix", None)))
2360+ .when(!dark, |d| {
2361+ d.child(
2362+ div()
2363+ .flex_none()
2364+ .px(px(6.))
2365+ .child("Mix — track volumes and the master limiter"),
2366+ )
2367+ })
2368+ .when(dark, |d| d.child(dark_help(help_text)))
2369+ .when(!dark, |d| {
2370+ d.child(
2371+ div()
2372+ .flex_none()
2373+ .px(px(6.))
2374+ .text_size(px(11.))
2375+ .text_color(rgb(FG_SECONDARY()))
2376+ .child(help_text),
2377+ )
2378+ })
21272379 .child(
21282380 div()
21292381 .id("mix-rows")
@@ -2133,23 +2385,20 @@ impl Player {
21332385 .overflow_y_scroll()
21342386 .children(rows),
21352387 )
2136- .child(
2137- div()
2138- .flex_none()
2139- .px(px(6.))
2140- .text_size(px(11.))
2141- .text_color(rgb(FG_SECONDARY()))
2142- // What the choice *is*: the limiter's own line,
2143- // because "on" alone says nothing about what it
2144- // does to a mix that never reaches the ceiling.
2145- .child(match limiter.on {
2146- true => format!(
2147- "the mix is held under {:+.0} dBFS — quieter passages are untouched",
2148- limiter.ceiling_db
2149- ),
2150- false => "the limiter is out of circuit — a hot mix clips at full scale".to_string(),
2151- }),
2152- ),
2388+ .when(dark, |d| d.child(dark_help(tail_text.clone())))
2389+ .when(!dark, |d| {
2390+ d.child(
2391+ div()
2392+ .flex_none()
2393+ .px(px(6.))
2394+ .text_size(px(11.))
2395+ .text_color(rgb(FG_SECONDARY()))
2396+ // What the choice *is*: the limiter's own line,
2397+ // because "on" alone says nothing about what it
2398+ // does to a mix that never reaches the ceiling.
2399+ .child(tail_text),
2400+ )
2401+ }),
21532402 ),
21542403 )
21552404 }
crates/app/src/ui/library.rsmodified+38 -10
@@ -2,6 +2,8 @@
22
33 use crate::*;
44 use crate::ui::widgets::*;
5+use crate::ui::type_scale::Typeset;
6+use crate::ui::stance::below_picture_floor;
57
68 impl Player {
79 /// The media library: a row per source the timeline knows, in the order
@@ -551,7 +553,11 @@ impl Player {
551553 ) -> Option<impl IntoElement> {
552554 let menu = self.library_menu.clone()?;
553555 let path = menu.path.clone();
554- let row = |n: usize| {
556+ // DESIGN §9: the same plate row treatment `Player::context_card`
557+ // draws with -- one function, so a copy-paste sibling menu cannot
558+ // drift from it (darkroom only; `OLD_GUI=1` is unchanged).
559+ let darkroom = self.darkroom;
560+ let row = move |n: usize| {
555561 div()
556562 .id(("library-menu", n))
557563 .flex()
@@ -561,6 +567,22 @@ impl Player {
561567 .gap(px(12.))
562568 .px(px(6.))
563569 .rounded(px(3.))
570+ .when(darkroom, |d| {
571+ d.type_style(crate::ui::type_scale::label(
572+ crate::ui::type_scale::LABEL_ROW_PX,
573+ gpui::FontWeight::MEDIUM,
574+ ))
575+ .text_color(rgb(INK2()))
576+ })
577+ };
578+ let chord_style = |d: Div| -> Div {
579+ d.when(darkroom, |d| {
580+ d.type_style(crate::ui::type_scale::mono(
581+ crate::ui::type_scale::CHORD_METADATA_MIN_PX,
582+ gpui::FontWeight::MEDIUM,
583+ ))
584+ .text_color(rgb(INK3()))
585+ })
564586 };
565587 let mut rows: Vec<AnyElement> = Vec::new();
566588 // What every item of this menu is answered from, read once.
@@ -618,14 +640,14 @@ impl Player {
618640 rows.push(
619641 row(rows.len())
620642 .child(label)
621- .child(
643+ .child(chord_style(
622644 div()
623645 .min_w(px(0.))
624646 .truncate()
625647 .text_size(px(11.))
626- .text_color(rgb(FG_SECONDARY()))
627- .child(value),
648+ .text_color(rgb(FG_SECONDARY())),
628649 )
650+ .child(value))
629651 .into_any_element(),
630652 );
631653 }
@@ -641,11 +663,13 @@ impl Player {
641663 row(rows.len())
642664 .child(item.label())
643665 .child(
644- div()
645- .min_w(px(0.))
646- .truncate()
647- .text_color(rgb(FG_SECONDARY()))
648- .child(refusal.why().unwrap_or_else(|| item.hint())),
666+ chord_style(
667+ div()
668+ .min_w(px(0.))
669+ .truncate()
670+ .text_color(rgb(FG_SECONDARY())),
671+ )
672+ .child(refusal.why().unwrap_or_else(|| item.hint())),
649673 )
650674 .when(!enabled, |d| d.opacity(0.4).cursor_not_allowed())
651675 .when(enabled, |d| {
@@ -662,7 +686,11 @@ impl Player {
662686 // Placed by the height it is drawn to, and drawn to what the window has
663687 // room for -- the clip menu's rule, one function for all three.
664688 let list_h = menu_rows_h(rows.len(), viewport);
665- let (x, y) = menu_at(menu.at, viewport, MENU_PAD * 2. + list_h);
689+ let mut at = menu.at;
690+ if darkroom {
691+ at.y = px(f32::from(at.y).max(below_picture_floor(f32::from(viewport.height))));
692+ }
693+ let (x, y) = menu_at(at, viewport, MENU_PAD * 2. + list_h);
666694 let full: SharedString = path.display().to_string().into();
667695 Some(
668696 scrim()
crates/app/src/ui/overlays.rsmodified+74 -16
@@ -2,6 +2,8 @@
22
33 use crate::*;
44 use crate::ui::widgets::*;
5+use crate::ui::stance::below_picture_floor;
6+use crate::ui::type_scale::{self, Typeset};
57
68 impl Player {
79 /// The running import holds its own bar above the notice's, for the notice
@@ -478,7 +480,13 @@ impl Player {
478480 let clip = session.lane_clips(menu.lane).get(menu.idx).copied();
479481 let source = clip.and_then(|clip| session.sources().get(clip.source).cloned());
480482 let secs = |frames: u32| timecode(f64::from(frames) / self.fps, self.fps);
481- let row = |n: usize| {
483+ // DESIGN §9/§3: a menu row is a plate row, Archivo at the room's
484+ // 10.5px row size -- `ink2`, dimmed to `ink3` on the disabled ones
485+ // below by the same `.opacity` every row already carried. Gated on
486+ // `self.darkroom` so `OLD_GUI=1` keeps its own unstyled rows exactly
487+ // as they draw today.
488+ let darkroom = self.darkroom;
489+ let row = move |n: usize| {
482490 div()
483491 .id(("menu", n))
484492 .flex()
@@ -490,6 +498,26 @@ impl Player {
490498 .gap(px(12.))
491499 .px(px(6.))
492500 .rounded(px(3.))
501+ .when(darkroom, |d| {
502+ d.type_style(type_scale::label(
503+ type_scale::LABEL_ROW_PX,
504+ gpui::FontWeight::MEDIUM,
505+ ))
506+ .text_color(rgb(INK2()))
507+ })
508+ };
509+ // The chord/metadata half of a row: mono, `ink3`, DESIGN §3's
510+ // 9.5-10px band -- every value that is data about the film rather
511+ // than a room verb goes through this rather than the row's ambient
512+ // Archivo.
513+ let chord_style = |d: Div| -> Div {
514+ d.when(darkroom, |d| {
515+ d.type_style(type_scale::mono(
516+ type_scale::CHORD_METADATA_MIN_PX,
517+ gpui::FontWeight::MEDIUM,
518+ ))
519+ .text_color(rgb(INK3()))
520+ })
493521 };
494522 let mut rows: Vec<AnyElement> = Vec::new();
495523 if let (true, Some((clip, source))) = (menu.details, clip.zip(source.clone())) {
@@ -520,7 +548,7 @@ impl Player {
520548 rows.push(
521549 row(rows.len())
522550 .child(label)
523- .child(
551+ .child(chord_style(
524552 div()
525553 .min_w(px(0.))
526554 .truncate()
@@ -528,9 +556,9 @@ impl Player {
528556 // pair is 25 characters and has to fit beside
529557 // its label inside `MENU_W`.
530558 .text_size(px(11.))
531- .text_color(rgb(FG_SECONDARY()))
532- .child(value),
559+ .text_color(rgb(FG_SECONDARY())),
533560 )
561+ .child(value))
534562 .into_any_element(),
535563 );
536564 }
@@ -570,15 +598,18 @@ impl Player {
570598 // One truncated line, like the details side: a
571599 // reason that wrapped would make the card taller
572600 // than the height `menu_at` placed it by.
573- Some(why) => div()
574- .min_w(px(0.))
575- .truncate()
576- .text_size(px(11.))
577- .text_color(rgb(FG_SECONDARY()))
578- .child(why),
579- None => div()
580- .flex_shrink_0()
581- .text_color(rgb(FG_SECONDARY()))
601+ Some(why) => chord_style(
602+ div()
603+ .min_w(px(0.))
604+ .truncate()
605+ .text_size(px(11.))
606+ .text_color(rgb(FG_SECONDARY())),
607+ )
608+ .child(why),
609+ // Every command wears its chord (DESIGN §4): mono,
610+ // `ink3`, the same face the spine badges and the
611+ // keys overlay already read theirs in.
612+ None => chord_style(div().flex_shrink_0().text_color(rgb(FG_SECONDARY())))
582613 .child(self.keymap.display(action)),
583614 })
584615 .when(!enabled, |d| d.opacity(0.4).cursor_not_allowed())
@@ -624,7 +655,7 @@ impl Player {
624655 .child("Properties")
625656 // No stroke reaches this one, and a blank column would read
626657 // as one that was forgotten.
627- .child(div().text_color(rgb(FG_SECONDARY())).child("…"))
658+ .child(chord_style(div().text_color(rgb(FG_SECONDARY()))).child("…"))
628659 .into_any_element()
629660 }));
630661 }
@@ -632,7 +663,16 @@ impl Player {
632663 // to are one number: placed by a taller one, the card would hang off the
633664 // window's floor -- the very thing the clamp is for.
634665 let list_h = menu_rows_h(rows.len(), viewport);
635- let (x, y) = menu_at(menu.at, viewport, MENU_PAD * 2. + list_h);
666+ // §5/§11 check 6: the picture is never covered. A right-click high on
667+ // the window would otherwise hang the menu at the pointer, straight
668+ // over the screen -- clamped below it into the bench/ledger/dock
669+ // footprint instead, darkroom only (the legacy tree has no such
670+ // fixed split to clamp against).
671+ let mut at = menu.at;
672+ if self.darkroom {
673+ at.y = px(f32::from(at.y).max(below_picture_floor(f32::from(viewport.height))));
674+ }
675+ let (x, y) = menu_at(at, viewport, MENU_PAD * 2. + list_h);
636676 let full: SharedString = source
637677 .map(|source| source.path.display().to_string())
638678 .unwrap_or_default()
@@ -716,6 +756,7 @@ impl Player {
716756 cx: &mut Context<Self>,
717757 ) -> Option<impl IntoElement> {
718758 let picker = self.picker?;
759+ let darkroom = self.darkroom;
719760 let rows: Vec<AnyElement> = self
720761 .choices(picker.of)
721762 .into_iter()
@@ -733,6 +774,13 @@ impl Player {
733774 .gap(px(12.))
734775 .px(px(6.))
735776 .rounded(px(3.))
777+ .when(darkroom, |d| {
778+ d.type_style(type_scale::label(
779+ type_scale::LABEL_ROW_PX,
780+ gpui::FontWeight::MEDIUM,
781+ ))
782+ .text_color(rgb(INK2()))
783+ })
736784 .cursor_pointer()
737785 .hover(|s| s.bg(rgb(BG_HOVER())))
738786 // The mark is a glyph as well as a highlight, like the
@@ -768,6 +816,12 @@ impl Player {
768816 true => FG_PRIMARY(),
769817 false => FG_SECONDARY(),
770818 }))
819+ .when(darkroom, |d| {
820+ d.type_style(type_scale::mono(
821+ type_scale::CHORD_METADATA_MIN_PX,
822+ gpui::FontWeight::MEDIUM,
823+ ))
824+ })
771825 .child(detail),
772826 )
773827 .on_click(
@@ -779,7 +833,11 @@ impl Player {
779833 // The window's own room, and the list scrolls only where the window has
780834 // none -- the clip menu's rule, one function for both.
781835 let list_h = menu_rows_h(rows.len(), viewport);
782- let (x, y) = menu_at(picker.at, viewport, MENU_PAD * 2. + list_h);
836+ let mut at = picker.at;
837+ if darkroom {
838+ at.y = px(f32::from(at.y).max(below_picture_floor(f32::from(viewport.height))));
839+ }
840+ let (x, y) = menu_at(at, viewport, MENU_PAD * 2. + list_h);
783841 Some(
784842 scrim()
785843 // Click away closes it, either button, swallowed so nothing
crates/app/src/ui/stance.rsmodified+11 -0
@@ -31,6 +31,17 @@ const LEDGER_H: f32 = 28.;
3131 /// Right side panel, fixed width, carrying the Src/Clip tab pair.
3232 const DOCK_W: f32 = 280.;
3333
34+/// The lowest a menu's top edge may sit and still land inside the
35+/// bench/ledger/dock footprint below the screen (DESIGN §5, §9, §11 check 6):
36+/// a right-click near the top of the window must not walk the menu up over
37+/// the picture just because the pointer is there. `overlays.rs`/`library.rs`
38+/// clamp their `menu.at.y` against this before handing it to `menu_at`, only
39+/// in the darkroom stance -- the legacy tree has no fixed screen/time-band
40+/// split for this to mean anything against, and must not move.
41+pub(crate) fn below_picture_floor(viewport_h: f32) -> f32 {
42+ (viewport_h - TIME_BAND_H - BENCH_H - LEDGER_H).max(0.)
43+}
44+
3445 thread_local! {
3546 // FAULT 3: the picture region's own laid-out box, measured each frame by
3647 // a [`bounds_probe`] the same shape `timeband_stance`'s contact strip