authorclover caruso <git@paperclover.net> 2026-10-11 12:54:33-07:00
committerclover caruso <git@paperclover.net> 2026-10-11 13:36:39-07:00
logd179e57e9d023e275f399908164444480b498def
treea8df7b6d4f5c1b49d1a2bef72ec3acb47fe3fce6
parent96eb01ef499be1bd5ba4792a1ae2191ad42bdf2d
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU (~clover)

fix: tint the Windows 7 toolbar over Aero glass

Derive the toolbar panel from the system glass color with an 80% to 90% opacity fade behind opaque controls. Deepen the dark tint to preserve foreground contrast over bright backgrounds. Keep the previous toolbar variants available for comparison. Refs #66 Assisted-by: gpt-6.1-sol

3 files changed, 20 insertions(+), 19 deletions(-)

arc/platforms.md+6-7
......@@ -146,13 +146,12 @@ keyboard, the toolbar and the macOS menu bar all run commands from it.
146146 and 10, whose frames are opaque, the window has no system frame and the
147147 row draws and runs caption buttons as 10 does, over acrylic on 10. Over
148148 7's glass, which takes any colour and whatever lies behind the window,
149 the toolbar keeps opaque faces under its icons: by default the strip is
150 opaque, as Explorer's command bar is under its glass, stopping short of the
151 caption buttons 7 draws beneath the window's pixels, and
152 `SNOWBOUND_W7_CHROME` tries the alternatives, `pills` for a face per group
153 of tools over the glass, `frost` for a strip the glass tints through, and
154 `tint` and `tint-tiles` for one panel or a tile per group in the glass's
155 colour at a lightness text keeps its contrast on, as Mica tints.
149 the toolbar gathers its tools on a panel in the glass's colour, fading from
150 80% to 90% opacity behind opaque icons. Its lightness keeps text legible
151 even over a bright desktop in the dark theme.
152 `SNOWBOUND_W7_CHROME` tries the alternatives: `bar` for an opaque strip,
153 `pills` for an opaque face per group, `frost` for a translucent strip,
154 and `tint-tiles` for a tinted face per group instead of one panel.
156155 The theme and material follow the system's colour mode as it changes.
157156 With Windows 7's basic or classic theme the system draws the title bar
158157 and the row lies beneath it, as on KDE.
crates/snowbound/src/main.rs+5
......@@ -6142,6 +6142,11 @@ fn tool_face(theme: &Theme, shown: bool, rise: f32) -> Spec<'static> {
61426142 }
61436143 Spec {
61446144 fill: Some(theme.tool),
6145 gradient: (theme.tool[3] < 1.0).then(|| {
6146 let mut bottom = theme.tool;
6147 bottom[3] = (bottom[3] + 0.1).min(1.0);
6148 bottom
6149 }),
61456150 border: Some(theme.chip),
61466151 radius: 4.0,
61476152 inset: [0.0, -rise, 0.0, -rise],
crates/snowbound/src/windows.rs+9-12
......@@ -725,17 +725,13 @@ pub fn titlebar(appearance: Theme) -> Option<[[f32; 4]; 2]> {
725725 })
726726}
727727
728/// The theme over the window's material. Aero glass takes whatever lies behind the window
729/// and any colour the user picks, so on Windows 7 the toolbar keeps opaque faces under its
730/// icons, as `SNOWBOUND_W7_CHROME` picks: `bar`, Explorer's opaque command bar under the glass
731/// frame; `pills`, a face per group of tools over the glass; `frost`, the strip see-through
732/// enough to tint it; or `tint`, one panel of tools in the glass's colour, and `tint-tiles`,
733/// a tile per group.
728/// The theme over the window's material, with a tinted translucent toolbar over Aero.
734729pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {
735730 if version() >= (6, 2, 0) {
736731 return theme.over_backdrop();
737732 }
738733 match std::env::var("SNOWBOUND_W7_CHROME").as_deref() {
734 Ok("bar") => theme,
739735 Ok("pills") => ui::Theme {
740736 strip: [0.0; 4],
741737 tool: theme.base,
......@@ -745,14 +741,13 @@ pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {
745741 strip: [theme.strip[0], theme.strip[1], theme.strip[2], 0.85],
746742 ..theme
747743 },
748 Ok(chrome @ ("tint" | "tint-tiles")) => ui::Theme {
744 chrome => ui::Theme {
749745 strip: [0.0; 4],
750746 tool: glass_tint(appearance == Theme::Dark),
751 tool_panel: chrome == "tint",
747 tool_panel: chrome != Ok("tint-tiles"),
752748 chip: [0.0, 0.0, 0.0, 0.35],
753749 ..theme
754750 },
755 _ => theme,
756751 }
757752}
758753
......@@ -770,11 +765,13 @@ fn glass_tint(dark: bool) -> [f32; 4] {
770765 (high - low) / 255.0 / (1.0 - (2.0 * lightness - 1.0).abs())
771766 };
772767 let strength = 0.85 * (0.6 + 0.4 * f32::from(intensity) / 255.0);
773 draw::hsl(
768 let mut tint = draw::hsl(
774769 draw::hue(draw::srgb(red, green, blue)),
775770 saturation * strength,
776 if dark { 0.22 } else { 0.84 },
777 )
771 if dark { 0.12 } else { 0.84 },
772 );
773 tint[3] = 0.8;
774 tint
778775}
779776
780777/// None: the kit's own menus.