forge
Explore
Log in

Don't you dare go Hollow

The clip section stops talking like a terminal

Browse files at this commit

a9e3dc3971f6df05bfb872b37a1809113dbd328eAhmet Kaan GümüşParent: 2d435c2978e685
  • style
    • the clip section stops talking like a terminal
Show full message
💄 style(ui): the clip section stops talking like a terminal

Seven static how-to sentences (~889 chars) leave the card bodies for a hover
'?' on the card head. Colour rows read as percent, transform rows carry deg,
x and percent instead of a bare {value:.2}. 'Tint (cool-warm)' becomes 'Tint'.
The Sources tab's four-clause paragraph becomes 'drag - add - double-click plays'.
crates/app/src/color_ui.rsmodified+1 -1
@@ -9,7 +9,7 @@ pub(crate) const COLOR_BANDS: [(&str, f32, f32); 4] = [
99 ("Brightness", -1., 1.),
1010 ("Contrast", 0., 2.),
1111 ("Saturation", 0., 2.),
12- ("Tint (cool–warm)", -1., 1.),
12+ ("Tint", -1., 1.),
1313 ];
1414
1515 /// 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] = [
2727 /// one row would be numbers nothing on screen answers to.
2828 pub(crate) const ROTATE_BAND: usize = 3;
2929
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+
3034 /// A press of a nudge key on every band but rotation: a fortieth-ish of a
3135 /// band's range, [`crate::color_ui::COLOR_STEP`]'s own reason. A drag lands on
3236 /// 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 {
2020 .child(text.into())
2121 }
2222
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+
2338 /// A row's value -- what the film/the setting *says*, mono per §3.
2439 fn dark_row_value(text: impl Into<SharedString>) -> Div {
2540 div()
@@ -30,8 +45,13 @@ fn dark_row_value(text: impl Into<SharedString>) -> Div {
3045
3146 /// A card's own head line: the verb in Archivo (§3 section-head casing) and,
3247 /// 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 {
48+/// is metadata about the footage, not the room's own voice. `help`, when
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 {
3555 div()
3656 .flex_none()
3757 .px(px(6.))
@@ -50,6 +70,15 @@ fn dark_card_head(verb: &str, meta: Option<SharedString>) -> Div {
5070 .text_color(rgb(INK3()))
5171 .child(m)
5272 }))
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+ }))
5382 }
5483
5584 /// The help/status line under a card's head: what the keys do, which is
@@ -1065,7 +1094,7 @@ impl Player {
10651094 .rounded(px(6.))
10661095 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
10671096 .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)))
10691098 .when(!dark, |d| d.child(div().flex_none().px(px(6.)).child("Exporting")))
10701099 // The bar itself: the same number as the percentage
10711100 // below it, and it only ever moves forward -- the
@@ -1490,6 +1519,7 @@ impl Player {
14901519 d.child(dark_card_head(
14911520 "Equalizer",
14921521 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()),
14931523 ))
14941524 })
14951525 .when(!dark, |d| {
@@ -1499,10 +1529,8 @@ impl Player {
14991529 idx + 1
15001530 )))
15011531 })
1502- .when(dark, |d| {
1503- d.child(dark_help(self.notices.front().cloned().unwrap_or_else(|| {
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- })))
1532+ .when(dark && self.notices.front().is_some(), |d| {
1533+ d.child(dark_help(self.notices.front().cloned().unwrap_or_default()))
15061534 })
15071535 .when(!dark, |d| {
15081536 d.child(
@@ -1924,11 +1952,11 @@ impl Player {
19241952 .child(
19251953 div()
19261954 .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.))))
19281956 .when(!dark, |d| {
19291957 d.text_size(px(11.))
19301958 .text_color(rgb(FG_SECONDARY()))
1931- .child(format!("{value:.2}"))
1959+ .child(format!("{:.0}%", value * 100.))
19321960 }),
19331961 )
19341962 })
@@ -1963,7 +1991,9 @@ impl Player {
19631991 .rounded(px(6.))
19641992 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
19651993 .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+ })
19671997 .when(!dark, |d| {
19681998 d.child(div().flex_none().px(px(6.)).child(format!(
19691999 "Colour — {} clip {}",
@@ -1971,7 +2001,6 @@ impl Player {
19712001 idx + 1
19722002 )))
19732003 })
1974- .when(dark, |d| d.child(dark_help(help_text)))
19752004 .when(!dark, |d| {
19762005 d.child(
19772006 div()
@@ -2105,17 +2134,11 @@ impl Player {
21052134 )
21062135 .child(
21072136 div().w(px(44.)).when(dark, |d| {
2108- d.child(dark_row_value(match i == ROTATE_BAND {
2109- true => format!("{value:.0}°"),
2110- false => format!("{value:.2}"),
2111- }))
2137+ d.child(dark_row_value(transform_row_value(i, value)))
21122138 }).when(!dark, |d| {
21132139 d.text_size(px(11.))
21142140 .text_color(rgb(FG_SECONDARY()))
2115- .child(match i == ROTATE_BAND {
2116- true => format!("{value:.0}°"),
2117- false => format!("{value:.2}"),
2118- })
2141+ .child(transform_row_value(i, value))
21192142 }),
21202143 )
21212144 })
@@ -2149,7 +2172,9 @@ impl Player {
21492172 .rounded(px(6.))
21502173 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
21512174 .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+ })
21532178 .when(!dark, |d| {
21542179 d.child(div().flex_none().px(px(6.)).child(format!(
21552180 "Transform — {} clip {}",
@@ -2157,7 +2182,6 @@ impl Player {
21572182 idx + 1
21582183 )))
21592184 })
2160- .when(dark, |d| d.child(dark_help(help_text)))
21612185 .when(!dark, |d| {
21622186 d.child(
21632187 div()
@@ -2287,7 +2311,9 @@ impl Player {
22872311 .rounded(px(6.))
22882312 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
22892313 .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+ })
22912317 .when(!dark, |d| {
22922318 d.child(div().flex_none().px(px(6.)).child(format!(
22932319 "Speed (tape) — {} clip {}",
@@ -2295,7 +2321,6 @@ impl Player {
22952321 idx + 1
22962322 )))
22972323 })
2298- .when(dark, |d| d.child(dark_help(help_text)))
22992324 .when(!dark, |d| {
23002325 d.child(
23012326 div()
@@ -2520,7 +2545,7 @@ impl Player {
25202545 .rounded(px(6.))
25212546 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
25222547 .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()))))
25242549 .when(!dark, |d| {
25252550 d.child(
25262551 div()
@@ -2529,7 +2554,6 @@ impl Player {
25292554 .child("Mix — track volumes and the master limiter"),
25302555 )
25312556 })
2532- .when(dark, |d| d.child(dark_help(help_text)))
25332557 .when(!dark, |d| {
25342558 d.child(
25352559 div()
@@ -2724,7 +2748,9 @@ impl Player {
27242748 .rounded(px(6.))
27252749 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
27262750 .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+ })
27282754 .when(!dark, |d| {
27292755 d.child(
27302756 div()
@@ -2733,7 +2759,6 @@ impl Player {
27332759 .child("Subtitle style — font and size of the cue plate"),
27342760 )
27352761 })
2736- .when(dark, |d| d.child(dark_help(help_text)))
27372762 .when(!dark, |d| {
27382763 d.child(
27392764 div()
@@ -2968,7 +2993,9 @@ impl Player {
29682993 .rounded(px(6.))
29692994 .bg(rgb(if dark { DARK_PANEL() } else { BG_RAISED() }))
29702995 .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+ })
29722999 .when(!dark, |d| {
29733000 d.child(div().flex_none().px(px(6.)).child(format!(
29743001 "Silences — {} clip {}",
@@ -2976,7 +3003,6 @@ impl Player {
29763003 idx + 1
29773004 )))
29783005 })
2979- .when(dark, |d| d.child(dark_help(help_text)))
29803006 .when(!dark, |d| {
29813007 d.child(
29823008 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 {
491491 .font(style.font)
492492 .text_size(style.size)
493493 .text_color(rgb(INK3()))
494- .child(
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- )
494+ .child("drag · ↵ add · double-click plays")
498495 })
499496 }
500497