From 5c9344c0b97d3c8fad3c45c6efc9f96764e2b447 Mon Sep 17 00:00:00 2001 From: Linkon <116425752+Linkon-lcw@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:20:22 +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=E7=AA=97=E5=8F=A3=E5=A4=A7=E5=B0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=9A=84=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E4=BB=85=E8=B0=83=E6=95=B4=E4=BD=8D=E7=BD=AE=EF=BC=8C=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E7=94=B1=E7=BB=84=E4=BB=B6=E7=AE=A1=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/services/SettingsService.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/services/SettingsService.ts b/src/main/services/SettingsService.ts index 06e20d3..8638710 100644 --- a/src/main/services/SettingsService.ts +++ b/src/main/services/SettingsService.ts @@ -59,7 +59,7 @@ export class SettingsService extends Service { wc.setZoomFactor(zoom) }) - // 更新全局侧边栏窗口的位置和大小 + // 仅更新全局侧边栏窗口的位置(不调整大小,大小由 GlobalSidebar 组件管理) const sidebarWindow = BrowserWindow.getAllWindows().find((win) => { try { return win.webContents.getURL().includes('#global-sidebar') @@ -71,16 +71,13 @@ export class SettingsService extends Service { if (sidebarWindow && !sidebarWindow.isDestroyed()) { const primaryDisplay = screen.getPrimaryDisplay() const { width, height } = primaryDisplay.workAreaSize - const baseWidth = 84 - const baseHeight = 300 - const winWidth = Math.round(baseWidth * zoom) - const winHeight = Math.round(baseHeight * zoom) + const bounds = sidebarWindow.getBounds() sidebarWindow.setBounds({ - x: width - winWidth, - y: Math.floor(height / 2 - winHeight / 2), - width: winWidth, - height: winHeight + x: width - bounds.width, + y: Math.floor(height / 2 - bounds.height / 2), + width: bounds.width, + height: bounds.height }) } }