diff --git a/frontend/assets/icons/GitpubDesktop-Icon.ico b/frontend/assets/icons/GitpubDesktop-Icon.ico new file mode 100644 index 0000000..734b08a Binary files /dev/null and b/frontend/assets/icons/GitpubDesktop-Icon.ico differ diff --git a/frontend/css/components.css b/frontend/css/components.css index 5b489a1..ffcf13b 100644 --- a/frontend/css/components.css +++ b/frontend/css/components.css @@ -174,7 +174,15 @@ flex: 1; display: flex; align-items: center; + gap: 14px; padding: 0 18px; + min-width: 0; +} + +.gd-toolbar-drag-space { + align-self: stretch; + flex: 1; + min-width: 40px; } /* Right section – view toggle + utility menu */ @@ -187,6 +195,38 @@ flex-shrink: 0; } +.gd-window-controls { + display: flex; + align-items: stretch; + flex-shrink: 0; + border-left: 1px solid rgba(229, 161, 62, 0.12); +} + +.gd-window-control { + display: inline-flex; + align-items: center; + justify-content: center; + width: 46px; + height: 100%; + padding: 0; + border: 0; + border-radius: 0; + background: transparent; + color: var(--text-muted); + cursor: pointer; + transition: background 0.12s ease, color 0.12s ease; +} + +.gd-window-control:hover { + background: rgba(229, 161, 62, 0.1); + color: var(--text-main); +} + +.gd-window-close:hover { + background: var(--danger); + color: #ffffff; +} + .gd-external-actions { display: flex; align-items: center; diff --git a/frontend/js/app.js b/frontend/js/app.js index 22bb565..84a3fb4 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -66,6 +66,53 @@ const PUSH_ICON = ``; const EXPLORER_ICON = ``; const EDITOR_ICON = ``; +const WINDOW_MINIMIZE_ICON = ``; +const WINDOW_MAXIMIZE_ICON = ``; +const WINDOW_CLOSE_ICON = ``; + +function currentTauriWindow() { + const tauriWindow = window.__TAURI__?.window; + if (tauriWindow?.getCurrentWindow) { + return tauriWindow.getCurrentWindow(); + } + return tauriWindow?.appWindow || null; +} + +async function handleWindowAction(action) { + const appWindow = currentTauriWindow(); + if (!appWindow) { + console.warn("Tauri window API not available"); + return; + } + + try { + if (action === "minimize") { + await appWindow.minimize(); + } else if (action === "maximize") { + const isMaximized = await appWindow.isMaximized(); + if (isMaximized) { + await appWindow.unmaximize(); + } else { + await appWindow.maximize(); + } + } else if (action === "close") { + await appWindow.close(); + } + } catch (error) { + console.error(`Unable to ${action} window:`, error); + } +} + +async function startWindowDrag() { + const appWindow = currentTauriWindow(); + if (!appWindow) return; + + try { + await appWindow.startDragging(); + } catch (error) { + console.error("Unable to start window drag:", error); + } +} function uid() { return `${Date.now()}-${Math.random().toString(16).slice(2)}`; @@ -1176,6 +1223,7 @@ function dashboardView() { ${escapeHtml(syncCfg.subLabel)} +
` : ""} +