diff --git a/Cargo.lock b/Cargo.lock index e61c7e00..f8164e37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3353,7 +3353,7 @@ dependencies = [ [[package]] name = "gpui-component" version = "0.5.2" -source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#070d1a28cec5130bf7c4c7895683595d488155b8" +source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#51a6925955adda598c9363915a06eae6de5dd8df" dependencies = [ "aho-corasick", "anyhow", @@ -3436,7 +3436,7 @@ dependencies = [ [[package]] name = "gpui-component-assets" version = "0.5.1" -source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#070d1a28cec5130bf7c4c7895683595d488155b8" +source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#51a6925955adda598c9363915a06eae6de5dd8df" dependencies = [ "anyhow", "gpui", @@ -3450,7 +3450,7 @@ dependencies = [ [[package]] name = "gpui-component-macros" version = "0.5.1" -source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#070d1a28cec5130bf7c4c7895683595d488155b8" +source = "git+https://github.com/l0ng-ai/gpui-component?branch=tty7#51a6925955adda598c9363915a06eae6de5dd8df" dependencies = [ "proc-macro2", "quote", diff --git a/src/ui/theme.rs b/src/ui/theme.rs index 20f2b02b..894eb8b1 100644 --- a/src/ui/theme.rs +++ b/src/ui/theme.rs @@ -780,6 +780,16 @@ pub(crate) fn apply_theme(mut window: Option<&mut Window>, cx: &mut App) { // give primary buttons, and the thumb to `primary_foreground`, which on a // dark theme is a black disc on a dark page. Side by side on one settings // page the two controls disagreed about what a set value looks like. + // + // Both were tried on `primary` — the neutral ramp the segmented controls + // and the sidebar's selected page are drawn from — to settle a complaint + // that the accent pills were the only saturated things on a screen of + // greys. Reverted on sight: a dark-grey "on" against a light-grey "off" is + // not a large enough step to read at a glance down a column of rows, and a + // switch whose state you have to look twice at has lost the one job it has. + // If the mismatch with the segmented controls is worth closing, it has to + // close from the other end — by giving *them* some accent — not by taking + // it away from here. t.tokens.slider_bar = Hsla::from(rgb(m.accent)).into(); t.tokens.slider_thumb = Hsla::from(rgb(knob)).into(); @@ -806,6 +816,18 @@ pub(crate) fn apply_theme(mut window: Option<&mut Window>, cx: &mut App) { t.radius = px(8.); + // Flat controls, floating panels. `Theme::shadow` gates exactly one thing — + // the `shadow_xs` an inline control (button, input, select trigger, + // checkbox, radio, slider knob) paints under itself — and never the drop + // shadow on a menu, tooltip or popover, which every one of those draws + // unconditionally. Left on, every field and button in the window carried a + // faint lift that nothing else here has: this chrome separates surfaces with + // low-contrast fills and hairlines, so a control sitting a millimetre above + // the panel was the one place claiming depth, and it read as a rendering + // artefact rather than as a material. Panels that really do float keep + // their shadow. + t.shadow = false; + let sidebar_bg = Hsla::from(rgb(m.sidebar)); let sidebar_sel = rgb(surfaces.sidebar.selected); // `t.sidebar` stays the opaque theme token: the settings theme picker @@ -881,6 +903,14 @@ pub(crate) fn apply_theme(mut window: Option<&mut Window>, cx: &mut App) { } } +/// Every switch in the window, built here so the on-state has one definition. +/// +/// The accent is load-bearing, not decoration. Without `.color()` a switch's +/// on-state falls to `tokens.primary`, a dark neutral, and against the light +/// neutral of the off-state that is too small a step to read while scanning a +/// column of rows — you end up checking the thumb's position on each one. It +/// was tried that way and reverted; see the slider-bar note in `apply_theme` +/// for the other half of the pair. pub(crate) fn switch(id: impl Into, cx: &App) -> gpui_component::switch::Switch { let accent = cx.global::().0; gpui_component::switch::Switch::new(id).color(Hsla::from(rgb(accent)))