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....@@ -146,13 +146,12 @@ keyboard, the toolbar and the macOS menu bar all run commands from it.
146 and 10, whose frames are opaque, the window has no system frame and the146 and 10, whose frames are opaque, the window has no system frame and the
147 row draws and runs caption buttons as 10 does, over acrylic on 10. Over147 row draws and runs caption buttons as 10 does, over acrylic on 10. Over
148 7's glass, which takes any colour and whatever lies behind the window,148 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 is149 the toolbar gathers its tools on a panel in the glass's colour, fading from
150 opaque, as Explorer's command bar is under its glass, stopping short of the150 80% to 90% opacity behind opaque icons. Its lightness keeps text legible
151 caption buttons 7 draws beneath the window's pixels, and151 even over a bright desktop in the dark theme.
152 `SNOWBOUND_W7_CHROME` tries the alternatives, `pills` for a face per group152 `SNOWBOUND_W7_CHROME` tries the alternatives: `bar` for an opaque strip,
153 of tools over the glass, `frost` for a strip the glass tints through, and153 `pills` for an opaque face per group, `frost` for a translucent strip,
154 `tint` and `tint-tiles` for one panel or a tile per group in the glass's154 and `tint-tiles` for a tinted face per group instead of one panel.
155 colour at a lightness text keeps its contrast on, as Mica tints.
156 The theme and material follow the system's colour mode as it changes.155 The theme and material follow the system's colour mode as it changes.
157 With Windows 7's basic or classic theme the system draws the title bar156 With Windows 7's basic or classic theme the system draws the title bar
158 and the row lies beneath it, as on KDE.157 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> {...@@ -6142,6 +6142,11 @@ fn tool_face(theme: &Theme, shown: bool, rise: f32) -> Spec<'static> {
6142 }6142 }
6143 Spec {6143 Spec {
6144 fill: Some(theme.tool),6144 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 }),
6145 border: Some(theme.chip),6150 border: Some(theme.chip),
6146 radius: 4.0,6151 radius: 4.0,
6147 inset: [0.0, -rise, 0.0, -rise],6152 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]> {...@@ -725,17 +725,13 @@ pub fn titlebar(appearance: Theme) -> Option<[[f32; 4]; 2]> {
725 })725 })
726}726}
727727
728/// The theme over the window's material. Aero glass takes whatever lies behind the window728/// The theme over the window's material, with a tinted translucent toolbar over Aero.
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.
734pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {729pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {
735 if version() >= (6, 2, 0) {730 if version() >= (6, 2, 0) {
736 return theme.over_backdrop();731 return theme.over_backdrop();
737 }732 }
738 match std::env::var("SNOWBOUND_W7_CHROME").as_deref() {733 match std::env::var("SNOWBOUND_W7_CHROME").as_deref() {
734 Ok("bar") => theme,
739 Ok("pills") => ui::Theme {735 Ok("pills") => ui::Theme {
740 strip: [0.0; 4],736 strip: [0.0; 4],
741 tool: theme.base,737 tool: theme.base,
...@@ -745,14 +741,13 @@ pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {...@@ -745,14 +741,13 @@ pub fn over_backdrop(theme: ui::Theme, appearance: Theme) -> ui::Theme {
745 strip: [theme.strip[0], theme.strip[1], theme.strip[2], 0.85],741 strip: [theme.strip[0], theme.strip[1], theme.strip[2], 0.85],
746 ..theme742 ..theme
747 },743 },
748 Ok(chrome @ ("tint" | "tint-tiles")) => ui::Theme {744 chrome => ui::Theme {
749 strip: [0.0; 4],745 strip: [0.0; 4],
750 tool: glass_tint(appearance == Theme::Dark),746 tool: glass_tint(appearance == Theme::Dark),
751 tool_panel: chrome == "tint",747 tool_panel: chrome != Ok("tint-tiles"),
752 chip: [0.0, 0.0, 0.0, 0.35],748 chip: [0.0, 0.0, 0.0, 0.35],
753 ..theme749 ..theme
754 },750 },
755 _ => theme,
756 }751 }
757}752}
758753
...@@ -770,11 +765,13 @@ fn glass_tint(dark: bool) -> [f32; 4] {...@@ -770,11 +765,13 @@ fn glass_tint(dark: bool) -> [f32; 4] {
770 (high - low) / 255.0 / (1.0 - (2.0 * lightness - 1.0).abs())765 (high - low) / 255.0 / (1.0 - (2.0 * lightness - 1.0).abs())
771 };766 };
772 let strength = 0.85 * (0.6 + 0.4 * f32::from(intensity) / 255.0);767 let strength = 0.85 * (0.6 + 0.4 * f32::from(intensity) / 255.0);
773 draw::hsl(768 let mut tint = draw::hsl(
774 draw::hue(draw::srgb(red, green, blue)),769 draw::hue(draw::srgb(red, green, blue)),
775 saturation * strength,770 saturation * strength,
776 if dark { 0.22 } else { 0.84 },771 if dark { 0.12 } else { 0.84 },
777 )772 );
773 tint[3] = 0.8;
774 tint
778}775}
779776
780/// None: the kit's own menus.777/// None: the kit's own menus.