From 5e71ad009064bfa61635fce7e7ac62cd09d91119 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Thu, 23 Jul 2026 10:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style(titlebar):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20Windows=20=E7=AA=97=E5=8F=A3=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 Windows 自绘标题栏控制组增加 4px 间距 - 保持其他平台及按钮尺寸、圆角和交互不变 - 新增平台选择器与间距接线回归测试 --- frontend/src/App.css | 4 ++++ frontend/src/App.tsx | 1 + frontend/src/App.window-controls-spacing.test.ts | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 frontend/src/App.window-controls-spacing.test.ts diff --git a/frontend/src/App.css b/frontend/src/App.css index 95806f97..e9e09ffa 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -411,6 +411,10 @@ body[data-theme='light'] .redis-viewer-workbench .ant-radio-button-wrapper-check } /* Custom Title Bar Close Button Hover */ +body[data-platform='windows'] .titlebar-window-controls { + gap: 4px; +} + .titlebar-close-btn:hover { background-color: #ff4d4f !important; color: #fff !important; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 673ddfcc..3b334359 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -7111,6 +7111,7 @@ function App() {
) : (
e.stopPropagation()} style={{ display: 'flex', height: '100%', WebkitAppRegion: 'no-drag', '--wails-draggable': 'no-drag' } as any} diff --git a/frontend/src/App.window-controls-spacing.test.ts b/frontend/src/App.window-controls-spacing.test.ts new file mode 100644 index 00000000..37ce25d9 --- /dev/null +++ b/frontend/src/App.window-controls-spacing.test.ts @@ -0,0 +1,15 @@ +import { readFileSync } from 'node:fs'; +import { describe, expect, it } from 'vitest'; + +const appSource = readFileSync(new URL('./App.tsx', import.meta.url), 'utf8'); +const appCssSource = readFileSync(new URL('./App.css', import.meta.url), 'utf8'); + +describe('Windows titlebar window controls spacing', () => { + it('adds a small platform-scoped gap between the custom window buttons', () => { + expect(appSource).toContain('className="titlebar-window-controls"'); + expect(appSource).toContain("document.body.setAttribute('data-platform', runtimePlatform || '')"); + expect(appCssSource).toMatch( + /body\[data-platform='windows'\]\s+\.titlebar-window-controls\s*\{[^}]*gap:\s*4px;/s, + ); + }); +});