From 3d704d747095f66e345905b87b2bf2d162b2ccf3 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:13:58 +0330 Subject: [PATCH] Import source: src/components/TitleBar Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/components/TitleBar.tsx | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/components/TitleBar.tsx diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx new file mode 100644 index 0000000..5f7a155 --- /dev/null +++ b/src/components/TitleBar.tsx @@ -0,0 +1,66 @@ +import { useEffect, useState } from "react"; +import { getCurrentWindow } from "@tauri-apps/api/window"; +import { Minus, Square, Copy, X } from "lucide-react"; + +const appWindow = getCurrentWindow(); + +/** + * Custom Windows title bar (window has decorations: false). + * Height 40px; the drag region spans everything except the buttons. + */ +export default function TitleBar() { + const [maximized, setMaximized] = useState(false); + + useEffect(() => { + appWindow.isMaximized().then(setMaximized); + const unlisten = appWindow.onResized(async () => { + setMaximized(await appWindow.isMaximized()); + }); + return () => { + unlisten.then((f) => f()); + }; + }, []); + + return ( +
+
+ + Notara + +
+
+ + + +
+
+ ); +}