From 7b5266af514db8d2aa393105ad06d82a5336f6c3 Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Tue, 1 Sep 2026 21:31:34 -0700 Subject: [PATCH] feat(windows): a Glass appearance for the Capacity Dock The second appearance now draws something: a translucent surface inside the rail's own outline, with a brighter rim than graphite gets, dark enough at 60 to 74 percent to carry the warm off-white type over any wallpaper. The mac's Liquid Glass, as far as a shaped window on Windows can go. It is painted rather than the acrylic window effect, because that effect cannot be shaped. Applying it and cutting the window down to the painted outlines was tried first: a polygon region built from the flattened rail and bubble paths, handed to SetWindowRgn, which reported success and left a complex region on the window. The blur was unmoved. DWM draws an accent backdrop for the whole window rectangle, and the dock's window is a good deal larger than the rail: it carries the fully expanded rail plus the bubble's reach, so the appearance was a grey slab a third of the screen tall with a faint rail inside it. The corner preference does not clip it either, which package B already found on the popover. So the setting is called Glass and not Acrylic, since a name that promises a blur it cannot give is worse than the honest one. The stored value still reads the old "acrylic" spelling. --- windows/src/Dock.tsx | 34 ++++++++++++++++++++++++---- windows/src/lib/dockPrefs.ts | 13 +++++++---- windows/src/settings/GeneralPane.tsx | 4 ---- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/windows/src/Dock.tsx b/windows/src/Dock.tsx index 2a2b7369..07c7d315 100644 --- a/windows/src/Dock.tsx +++ b/windows/src/Dock.tsx @@ -639,6 +639,12 @@ export function Dock() { if (glide && glideProgress >= 1) setGlide(null) }, [glide, glideProgress]) + // The mac's second appearance. Windows cannot shape its acrylic material, so the glass is + // painted inside the same outline as the graphite surface: translucent enough for the + // desktop to move behind it, dark enough to carry the warm off-white type over any + // wallpaper, with a brighter rim than graphite gets. + const glass = prefs.theme === 'glass' + const surfaceFill = glass ? 'url(#dock-glass-fill)' : 'url(#dock-rail-fill)' const edge = flareEdge const vertical = railVertical const cross = vertical ? m.railWidth : m.horizontalRailWidth @@ -707,6 +713,16 @@ export function Dock() { + + + + + + + + + + @@ -718,9 +734,14 @@ export function Dock() { - + - +
{ordered.map((provider, index) => { @@ -758,9 +779,14 @@ export function Dock() { > {detailH > 0 ? ( ) : null} diff --git a/windows/src/lib/dockPrefs.ts b/windows/src/lib/dockPrefs.ts index db7e8b86..e847119d 100644 --- a/windows/src/lib/dockPrefs.ts +++ b/windows/src/lib/dockPrefs.ts @@ -7,14 +7,17 @@ import { invoke } from '@tauri-apps/api/core' import { listen } from '@tauri-apps/api/event' -export type DockTheme = 'graphite' | 'acrylic' +export type DockTheme = 'graphite' | 'glass' export type DockGaugeShape = 'circle' | 'squircle' export const DOCK_THEMES: Array<{ id: DockTheme; label: string }> = [ { id: 'graphite', label: 'Graphite' }, - // The mac's second appearance is Liquid Glass; the Windows equivalent is the acrylic - // window effect, so it is named after what it actually is here. - { id: 'acrylic', label: 'Acrylic' }, + // The mac's second appearance is Liquid Glass. Windows cannot shape its acrylic material: + // the DWM backdrop is drawn for the whole window rectangle and neither a window region nor + // the corner preference clips it, and the dock's window is far bigger than the rail it + // paints. So this is a translucent surface the page draws inside the rail's own outline, + // which is what "glass" can mean for a shaped window here. + { id: 'glass', label: 'Glass' }, ] export const DOCK_GAUGE_SHAPES: Array<{ id: DockGaugeShape; label: string }> = [ @@ -58,7 +61,7 @@ export function parseDockPrefs(raw: Record): DockPrefs { enabled: raw.enabled === true, preferred: typeof raw.preferred === 'string' ? raw.preferred : null, scale: Math.min(DOCK_SCALE_MAX, Math.max(DOCK_SCALE_MIN, scale)), - theme: raw.theme === 'acrylic' ? 'acrylic' : 'graphite', + theme: raw.theme === 'glass' || raw.theme === 'acrylic' ? 'glass' : 'graphite', gaugeShape: raw.gaugeShape === 'squircle' ? 'squircle' : 'circle', providers: Array.isArray(raw.providers) ? raw.providers.filter((p): p is string => typeof p === 'string') : [], manualSelection: raw.manualSelection === true, diff --git a/windows/src/settings/GeneralPane.tsx b/windows/src/settings/GeneralPane.tsx index ba40c819..627d126c 100644 --- a/windows/src/settings/GeneralPane.tsx +++ b/windows/src/settings/GeneralPane.tsx @@ -363,10 +363,6 @@ function CapacityDockSection({ quota }: { quota: QuotaState }) { ) }) )} - - Appearance and gauge shape are stored now and the rail picks them up with the Capacity - Dock work that follows this one. - ) }