diff options
Diffstat (limited to 'renderer/src/components/Header.tsx')
| -rw-r--r-- | renderer/src/components/Header.tsx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/renderer/src/components/Header.tsx b/renderer/src/components/Header.tsx index 3a530d3..1d954ec 100644 --- a/renderer/src/components/Header.tsx +++ b/renderer/src/components/Header.tsx | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | import React, { useState } from "react"; | 1 | import React, { useState, useEffect } from "react"; |
| 2 | import type { Project, Session, Phase } from "../types"; | 2 | import type { Project, Session, Phase } from "../types"; |
| 3 | 3 | ||
| 4 | const api = window.api; | ||
| 5 | |||
| 4 | type Theme = "dark" | "light"; | 6 | type Theme = "dark" | "light"; |
| 5 | 7 | ||
| 6 | interface HeaderProps { | 8 | interface HeaderProps { |
| @@ -86,6 +88,16 @@ export function Header({ | |||
| 86 | setIsRenamingSession(false); | 88 | setIsRenamingSession(false); |
| 87 | }; | 89 | }; |
| 88 | 90 | ||
| 91 | // ── Maximize ───────────────────────────────────────────────── | ||
| 92 | const [isMaximized, setIsMaximized] = useState(false); | ||
| 93 | |||
| 94 | useEffect(() => { | ||
| 95 | // Returns the unsubscribe function; React cleanup calls it on unmount. | ||
| 96 | // On macOS, clicking the native green traffic light also fires this, | ||
| 97 | // keeping the glyph accurate when native controls are used. | ||
| 98 | return api.onWindowMaximized(setIsMaximized); | ||
| 99 | }, []); | ||
| 100 | |||
| 89 | // ── Branch copy ────────────────────────────────────────────── | 101 | // ── Branch copy ────────────────────────────────────────────── |
| 90 | const [copied, setCopied] = useState(false); | 102 | const [copied, setCopied] = useState(false); |
| 91 | 103 | ||
| @@ -225,6 +237,15 @@ export function Header({ | |||
| 225 | {theme === "dark" ? "[light]" : "[dark]"} | 237 | {theme === "dark" ? "[light]" : "[dark]"} |
| 226 | </button> | 238 | </button> |
| 227 | 239 | ||
| 240 | {/* ── Maximize toggle ── */} | ||
| 241 | <button | ||
| 242 | className="maximize-btn" | ||
| 243 | onClick={() => api.toggleMaximize()} | ||
| 244 | title={isMaximized ? "Restore window" : "Maximize window"} | ||
| 245 | > | ||
| 246 | {isMaximized ? '⊡' : '□'} | ||
| 247 | </button> | ||
| 248 | |||
| 228 | {/* ── Settings button ── */} | 249 | {/* ── Settings button ── */} |
| 229 | <button className="settings-btn" onClick={onOpenSettings} title="Settings"> | 250 | <button className="settings-btn" onClick={onOpenSettings} title="Settings"> |
| 230 | ⚙ | 251 | ⚙ |
