forge
Explore
Log in

Don't you dare go Hollow

Merge remote-tracking branch 'origin-local/main' into worktree-agent-a2c8a5611da360e1d

Browse files at this commit

5480ccbc4b3f9d271411232865e649730c353c69Ahmet Kaan GümüşParent: e964420a9e3dc3
crates/app/src/color_ui.rsmodified+1 -1
@@ -9,7 +9,7 @@ pub(crate) const COLOR_BANDS: [(&str, f32, f32); 4] = [
9 ("Brightness", -1., 1.),9 ("Brightness", -1., 1.),
10 ("Contrast", 0., 2.),10 ("Contrast", 0., 2.),
11 ("Saturation", 0., 2.),11 ("Saturation", 0., 2.),
12- ("Tint (cool–warm)", -1., 1.),12+ ("Tint", -1., 1.),
13 ];13 ];
14 14
15 /// A press of a nudge key: a fortieth of a band's range, so a slider crosses it15 /// A press of a nudge key: a fortieth of a band's range, so a slider crosses it
crates/app/src/transform_ui.rsmodified+4 -0
@@ -27,6 +27,10 @@ pub(crate) const TRANSFORM_BANDS: [(&str, f32, f32); 8] = [
27 /// one row would be numbers nothing on screen answers to.27 /// one row would be numbers nothing on screen answers to.
28 pub(crate) const ROTATE_BAND: usize = 3;28 pub(crate) const ROTATE_BAND: usize = 3;
29 29
30+/// Which band is scale: the one control on the card whose unit is a
31+/// multiplier (`×`) rather than a percent of frame or a degree.
32+pub(crate) const SCALE_BAND: usize = 2;
33+
30 /// A press of a nudge key on every band but rotation: a fortieth-ish of a34 /// A press of a nudge key on every band but rotation: a fortieth-ish of a
31 /// band's range, [`crate::color_ui::COLOR_STEP`]'s own reason. A drag lands on35 /// band's range, [`crate::color_ui::COLOR_STEP`]'s own reason. A drag lands on
32 /// the same grid ([`Player::drag_transform`]).36 /// the same grid ([`Player::drag_transform`]).
crates/app/src/ui/cards.rsmodified+55 -29
@@ -20,6 +20,21 @@ fn dark_row_label(text: impl Into<SharedString>, picked: bool) -> Div {
20 .child(text.into())20 .child(text.into())
21 }21 }
22 22
23+/// A transform row's value with its unit: degrees for rotation, `×` for
24+/// scale (a multiplier, not a fraction of the frame), percent for
25+/// position/crop (both are a fraction of the frame's own size) -- the bare
26+/// `{value:.2}` this used to print could not tell a percent from a
27+/// multiplier apart.
28+fn transform_row_value(band: usize, value: f32) -> String {
29+ if band == ROTATE_BAND {
30+ format!("{value:.0}°")
31+ } else if band == SCALE_BAND {
32+ format!("{value:.2}×")
33+ } else {
34+ format!("{:.0}%", value * 100.)
35+ }
36+}
37+
23 /// A row's value -- what the film/the setting *says*, mono per §3.38 /// A row's value -- what the film/the setting *says*, mono per §3.
24 fn dark_row_value(text: impl Into<SharedString>) -> Div {39 fn dark_row_value(text: impl Into<SharedString>) -> Div {
25 div()40 div()
@@ -30,8 +45,13 @@ fn dark_row_value(text: impl Into<SharedString>) -> Div {
30 45
31 /// A card's own head line: the verb in Archivo (§3 section-head casing) and,46 /// 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"47 /// 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.48+/// is metadata about the footage, not the room's own voice. `help`, when
34-fn dark_card_head(verb: &str, meta: Option<SharedString>) -> Div {49+/// given, is the card's own how-to sentence -- it used to sit under the
50+/// head as a permanent line (a terminal-screen row of prose the user named
51+/// directly); now it rides a `?` glyph beside the head and only shows on
52+/// hover, the same hover-only convention [`dock_stance::ghost_verb`]
53+/// already uses for a verb's own description.
54+fn dark_card_head(verb: &str, meta: Option<SharedString>, help: Option<SharedString>) -> Div {
35 div()55 div()
36 .flex_none()56 .flex_none()
37 .px(px(6.))57 .px(px(6.))
@@ -50,6 +70,15 @@ fn dark_card_head(verb: &str, meta: Option<SharedString>) -> Div {
50 .text_color(rgb(INK3()))70 .text_color(rgb(INK3()))
51 .child(m)71 .child(m)
52 }))72 }))
73+ .children(help.map(|h| {
74+ div()
75+ .id("card-head-help")
76+ .flex_none()
77+ .type_style(type_scale::mono(type_scale::CHORD_METADATA_MAX_PX, gpui::FontWeight::MEDIUM))
78+ .text_color(rgb(INK3()))
79+ .tooltip(move |_, cx| cx.new(|_| Tip(h.clone())).into())
80+ .child("?")
81+ }))
53 }82 }
54 83
55 /// The help/status line under a card's head: what the keys do, which is84 /// The help/status line under a card's head: what the keys do, which is
@@ -1065,7 +1094,7 @@ impl Player {
1065 .rounded(px(6.))1094 .rounded(px(6.))
1066 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))1095 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1067 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))1096 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1068- .when(dark, |d| d.child(dark_card_head("Exporting", None)))1097+ .when(dark, |d| d.child(dark_card_head("Exporting", None, None)))
1069 .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting")))1098 .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting")))
1070 // The bar itself: the same number as the percentage1099 // The bar itself: the same number as the percentage
1071 // below it, and it only ever moves forward -- the1100 // below it, and it only ever moves forward -- the
@@ -1490,6 +1519,7 @@ impl Player {
1490 d.child(dark_card_head(1519 d.child(dark_card_head(
1491 "Equalizer",1520 "Equalizer",
1492 Some(format!("{} clip {}", lane.label(), idx + 1).into()),1521 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()),
1493 ))1523 ))
1494 })1524 })
1495 .when(!dark, |d| {1525 .when(!dark, |d| {
@@ -1499,10 +1529,8 @@ impl Player {
1499 idx + 11529 idx + 1
1500 )))1530 )))
1501 })1531 })
1502- .when(dark, |d| {1532+ .when(dark && self.notices.front().is_some(), |d| {
1503- d.child(dark_help(self.notices.front().cloned().unwrap_or_else(|| {1533+ d.child(dark_help(self.notices.front().cloned().unwrap_or_default()))
1504- "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()
1505- })))
1506 })1534 })
1507 .when(!dark, |d| {1535 .when(!dark, |d| {
1508 d.child(1536 d.child(
@@ -1924,11 +1952,11 @@ impl Player {
1924 .child(1952 .child(
1925 div()1953 div()
1926 .w(px(44.))1954 .w(px(44.))
1927- .when(dark, |d| d.child(dark_row_value(format!("{value:.2}"))))1955+ .when(dark, |d| d.child(dark_row_value(format!("{:.0}%", value * 100.))))
1928 .when(!dark, |d| {1956 .when(!dark, |d| {
1929 d.text_size(px(11.))1957 d.text_size(px(11.))
1930 .text_color(rgb(FG_SECONDARY()))1958 .text_color(rgb(FG_SECONDARY()))
1931- .child(format!("{value:.2}"))1959+ .child(format!("{:.0}%", value * 100.))
1932 }),1960 }),
1933 )1961 )
1934 })1962 })
@@ -1963,7 +1991,9 @@ impl Player {
1963 .rounded(px(6.))1991 .rounded(px(6.))
1964 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))1992 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
1965 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))1993 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
1966- .when(dark, |d| d.child(dark_card_head("Colour", Some(head_meta.clone()))))1994+ .when(dark, |d| {
1995+ d.child(dark_card_head("Colour", Some(head_meta.clone()), Some(help_text.into())))
1996+ })
1967 .when(!dark, |d| {1997 .when(!dark, |d| {
1968 d.child(div().flex_none().px(px(6.)).child(format!(1998 d.child(div().flex_none().px(px(6.)).child(format!(
1969 "Colour — {} clip {}",1999 "Colour — {} clip {}",
@@ -1971,7 +2001,6 @@ impl Player {
1971 idx + 12001 idx + 1
1972 )))2002 )))
1973 })2003 })
1974- .when(dark, |d| d.child(dark_help(help_text)))
1975 .when(!dark, |d| {2004 .when(!dark, |d| {
1976 d.child(2005 d.child(
1977 div()2006 div()
@@ -2105,17 +2134,11 @@ impl Player {
2105 )2134 )
2106 .child(2135 .child(
2107 div().w(px(44.)).when(dark, |d| {2136 div().w(px(44.)).when(dark, |d| {
2108- d.child(dark_row_value(match i == ROTATE_BAND {2137+ d.child(dark_row_value(transform_row_value(i, value)))
2109- true => format!("{value:.0}°"),
2110- false => format!("{value:.2}"),
2111- }))
2112 }).when(!dark, |d| {2138 }).when(!dark, |d| {
2113 d.text_size(px(11.))2139 d.text_size(px(11.))
2114 .text_color(rgb(FG_SECONDARY()))2140 .text_color(rgb(FG_SECONDARY()))
2115- .child(match i == ROTATE_BAND {2141+ .child(transform_row_value(i, value))
2116- true => format!("{value:.0}°"),
2117- false => format!("{value:.2}"),
2118- })
2119 }),2142 }),
2120 )2143 )
2121 })2144 })
@@ -2149,7 +2172,9 @@ impl Player {
2149 .rounded(px(6.))2172 .rounded(px(6.))
2150 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2173 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2151 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2174 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2152- .when(dark, |d| d.child(dark_card_head("Transform", Some(head_meta.clone()))))2175+ .when(dark, |d| {
2176+ d.child(dark_card_head("Transform", Some(head_meta.clone()), Some(help_text.into())))
2177+ })
2153 .when(!dark, |d| {2178 .when(!dark, |d| {
2154 d.child(div().flex_none().px(px(6.)).child(format!(2179 d.child(div().flex_none().px(px(6.)).child(format!(
2155 "Transform — {} clip {}",2180 "Transform — {} clip {}",
@@ -2157,7 +2182,6 @@ impl Player {
2157 idx + 12182 idx + 1
2158 )))2183 )))
2159 })2184 })
2160- .when(dark, |d| d.child(dark_help(help_text)))
2161 .when(!dark, |d| {2185 .when(!dark, |d| {
2162 d.child(2186 d.child(
2163 div()2187 div()
@@ -2287,7 +2311,9 @@ impl Player {
2287 .rounded(px(6.))2311 .rounded(px(6.))
2288 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2312 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2289 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2313 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2290- .when(dark, |d| d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()))))2314+ .when(dark, |d| {
2315+ d.child(dark_card_head("Speed (tape)", Some(head_meta.clone()), Some(help_text.into())))
2316+ })
2291 .when(!dark, |d| {2317 .when(!dark, |d| {
2292 d.child(div().flex_none().px(px(6.)).child(format!(2318 d.child(div().flex_none().px(px(6.)).child(format!(
2293 "Speed (tape) — {} clip {}",2319 "Speed (tape) — {} clip {}",
@@ -2295,7 +2321,6 @@ impl Player {
2295 idx + 12321 idx + 1
2296 )))2322 )))
2297 })2323 })
2298- .when(dark, |d| d.child(dark_help(help_text)))
2299 .when(!dark, |d| {2324 .when(!dark, |d| {
2300 d.child(2325 d.child(
2301 div()2326 div()
@@ -2520,7 +2545,7 @@ impl Player {
2520 .rounded(px(6.))2545 .rounded(px(6.))
2521 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2546 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2522 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2547 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2523- .when(dark, |d| d.child(dark_card_head("Mix", None)))2548+ .when(dark, |d| d.child(dark_card_head("Mix", None, Some(help_text.into()))))
2524 .when(!dark, |d| {2549 .when(!dark, |d| {
2525 d.child(2550 d.child(
2526 div()2551 div()
@@ -2529,7 +2554,6 @@ impl Player {
2529 .child("Mix — track volumes and the master limiter"),2554 .child("Mix — track volumes and the master limiter"),
2530 )2555 )
2531 })2556 })
2532- .when(dark, |d| d.child(dark_help(help_text)))
2533 .when(!dark, |d| {2557 .when(!dark, |d| {
2534 d.child(2558 d.child(
2535 div()2559 div()
@@ -2724,7 +2748,9 @@ impl Player {
2724 .rounded(px(6.))2748 .rounded(px(6.))
2725 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2749 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2726 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2750 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2727- .when(dark, |d| d.child(dark_card_head("Subtitle style", None)))2751+ .when(dark, |d| {
2752+ d.child(dark_card_head("Subtitle style", None, Some(help_text.into())))
2753+ })
2728 .when(!dark, |d| {2754 .when(!dark, |d| {
2729 d.child(2755 d.child(
2730 div()2756 div()
@@ -2733,7 +2759,6 @@ impl Player {
2733 .child("Subtitle style — font and size of the cue plate"),2759 .child("Subtitle style — font and size of the cue plate"),
2734 )2760 )
2735 })2761 })
2736- .when(dark, |d| d.child(dark_help(help_text)))
2737 .when(!dark, |d| {2762 .when(!dark, |d| {
2738 d.child(2763 d.child(
2739 div()2764 div()
@@ -2968,7 +2993,9 @@ impl Player {
2968 .rounded(px(6.))2993 .rounded(px(6.))
2969 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))2994 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
2970 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))2995 .when(dark, |d| d.border_1().border_color(rgba(DARK_SEAM())))
2971- .when(dark, |d| d.child(dark_card_head("Silences", Some(head_meta.clone()))))2996+ .when(dark, |d| {
2997+ d.child(dark_card_head("Silences", Some(head_meta.clone()), Some(help_text.into())))
2998+ })
2972 .when(!dark, |d| {2999 .when(!dark, |d| {
2973 d.child(div().flex_none().px(px(6.)).child(format!(3000 d.child(div().flex_none().px(px(6.)).child(format!(
2974 "Silences — {} clip {}",3001 "Silences — {} clip {}",
@@ -2976,7 +3003,6 @@ impl Player {
2976 idx + 13003 idx + 1
2977 )))3004 )))
2978 })3005 })
2979- .when(dark, |d| d.child(dark_help(help_text)))
2980 .when(!dark, |d| {3006 .when(!dark, |d| {
2981 d.child(3007 d.child(
2982 div()3008 div()
crates/app/src/ui/dock_stance.rsmodified+1 -4
@@ -491,10 +491,7 @@ fn sources_tab(player: &Player, cx: &mut Context<Player>) -> impl IntoElement {
491 .font(style.font)491 .font(style.font)
492 .text_size(style.size)492 .text_size(style.size)
493 .text_color(rgb(INK3()))493 .text_color(rgb(INK3()))
494- .child(494+ .child("drag · ↵ add · double-click plays")
495- "drag a row to a lane · ↵ add at playhead · double-click plays in screen · \
496- right-click the dot to re-ink a source (rare — lives out of the way)",
497- )
498 })495 })
499 }496 }
500 497