From 5f201a35ec5fdd6d0e93d383bfcabd6db35c3a98 Mon Sep 17 00:00:00 2001 From: Prozilla Date: Sat, 29 Jul 2023 17:53:54 +0200 Subject: [PATCH] Added dynamic window title --- src/components/windows/Window.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/windows/Window.jsx b/src/components/windows/Window.jsx index 34dce75..6434406 100644 --- a/src/components/windows/Window.jsx +++ b/src/components/windows/Window.jsx @@ -23,12 +23,15 @@ import Vector2 from "../../features/math/vector2.js"; export function Window({ id, app, size, position, focused = false, onInteract, options }) { const windowsManager = useWindowsManager(); const nodeRef = useRef(null); + const [maximized, setMaximized] = useState(false); const [minimized, setMinimized] = useState(false); const [screenWidth, setScreenWidth] = useState(100); const [screenHeight, setScreenHeight] = useState(100); + const [title, setTitle] = useState(app.name); + useEffect(() => { const resizeObserver = new ResizeObserver((event) => { setScreenWidth(event[0].contentBoxSize[0].inlineSize); @@ -73,7 +76,7 @@ export function Window({ id, app, size, position, focused = false, onInteract, o >
-

{app.name}

+

{title}

@@ -85,7 +88,7 @@ export function Window({ id, app, size, position, focused = false, onInteract, o
- +