From 8b4da6a44f55ff4cc3632f2b50f6bc4add8d6d74 Mon Sep 17 00:00:00 2001 From: Linkon <116425752+Linkon-lcw@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:21:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=A9=E6=94=BE=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E6=97=B6=E4=BE=A7=E8=BE=B9=E6=A0=8F=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=9C=AA=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/GlobalSidebar.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/GlobalSidebar.tsx b/src/renderer/src/components/GlobalSidebar.tsx index 893e2b3..e18247d 100644 --- a/src/renderer/src/components/GlobalSidebar.tsx +++ b/src/renderer/src/components/GlobalSidebar.tsx @@ -30,13 +30,25 @@ export const GlobalSidebar: React.FC = () => { const unsubscribe = (window as any).api.onSettingChanged((change: any) => { if (change?.key === 'window_zoom') { setZoom(change.value) + // 缩放变化时,重新应用当前展开/收缩状态的窗口大小 + if ((window as any).api) { + if (expanded) { + const width = Math.round(84 * change.value) + const height = Math.round(300 * change.value) + ;(window as any).api.windowResize(width, height) + } else { + const width = Math.round(24 * change.value) + const height = Math.round(300 * change.value) + ;(window as any).api.windowResize(width, height) + } + } } }) return () => { if (typeof unsubscribe === 'function') unsubscribe() } - }, []) + }, [expanded]) const handleExpand = () => { // 1. 先隐藏三角