Skip to content

An open-source, self-hosted system for apps built with web technologies.

Standard windows float with the Appearance shadow at its xlarge level, shared with the Start Menu and the Map

zohayrslileh280115680cae
diff --git a/source/client/view/appearance/floating-shadow.ts b/source/client/view/appearance/floating-shadow.ts
new file mode 100644
index 0000000..680cd04
--- /dev/null
+++ b/source/client/view/appearance/floating-shadow.ts
@@ -0,0 +1,5 @@
+/**
+ * The Appearance shadow at its `xlarge` level, for what floats above the Desktop: standard windows,
+ * the Start menu and the Map.
+ */
+export const floatingShadow = Object.freeze({ x: "xlarge", y: "xlarge", blur: "xlarge", spread: "xlarge", opacity: "xlarge" } as const)
diff --git a/source/client/view/structure/desktop/windows/window-surface.tsx b/source/client/view/structure/desktop/windows/window-surface.tsx
index 1755b20..8169bcd 100644
--- a/source/client/view/structure/desktop/windows/window-surface.tsx
+++ b/source/client/view/structure/desktop/windows/window-surface.tsx
@@ -6,10 +6,11 @@ import { type PresentationAnimation } from "@client/view/components/desktop-host
import { type AppearanceColor, type PresentationSurface as WindowSurfaceDefinition } from "@phreshos/core"
import { surfaceLifecyclePose, surfacePresenceTransition } from "@client/view/appearance/surface-presence"
import { resolveWindowTransaction } from "@client/view/appearance/motion"
+import { floatingShadow } from "@client/view/appearance/floating-shadow"
import { useAppearance } from "@phreshos/react-ui"
/** Paints the optional Desktop-owned backing surface for a supported presentation. */
-export default function WindowSurface({ surface, active = true, animation, onComplete }: WindowSurfaceProps) {
+export default function WindowSurface({ surface, active = true, floating = false, animation, onComplete }: WindowSurfaceProps) {
const reducedMotion = useReducedMotion()
const appearance = useAppearance()
@@ -60,6 +61,7 @@ export default function WindowSurface({ surface, active = true, animation, onCom
color={surfaceColor(retained.current)}
material={surfaceMaterial(retained.current, active)}
radius={windowSurfaceRadius(retained.current, appearance)}
+ shadow={floating ? floatingShadow : true}
style={{ position: "absolute", inset: 0 }}
/>
</motion.div>
@@ -72,6 +74,9 @@ interface WindowSurfaceProps {
/** Whether this is the front window. Only the front window is frosted. */
active?: boolean
+ /** Whether the window floats above the Desktop, as a standard window does, with a deeper shadow. */
+ floating?: boolean
+
animation: PresentationAnimation | null
onComplete: (revision: number) => void
diff --git a/source/client/view/structure/desktop/windows/window.tsx b/source/client/view/structure/desktop/windows/window.tsx
index 92d2711..066ae33 100644
--- a/source/client/view/structure/desktop/windows/window.tsx
+++ b/source/client/view/structure/desktop/windows/window.tsx
@@ -695,6 +695,7 @@ export default function ({ title, header = true, surface, layer, icon, children,
<WindowSurface
surface={surfaceDefinition}
active={active}
+ floating
animation={surfaceAnimation ?? null}
onComplete={revision => onPresentationAnimationComplete?.("surface", revision)}
/>