From f7df9ec80421bc12e63e15d8a7ce40a1321c992c Mon Sep 17 00:00:00 2001 From: BTMuli Date: Fri, 27 Feb 2026 22:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20UI=E9=80=82=E9=85=8D=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20.v-application=20=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=AF=BC=E8=87=B4=E5=88=86=E4=BA=AB=E5=9B=BE?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index fddcfa4d..9a4d0ecf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,7 +28,7 @@ import useAppStore from "@store/app.js"; import useUserStore from "@store/user.js"; import { app, core, event, webviewWindow } from "@tauri-apps/api"; import type { Event, UnlistenFn } from "@tauri-apps/api/event"; -import { getCurrentWindow, LogicalSize } from "@tauri-apps/api/window"; +import { getCurrentWindow, LogicalPosition, LogicalSize } from "@tauri-apps/api/window"; import { type CliMatches, getMatches } from "@tauri-apps/plugin-cli"; import { mkdir } from "@tauri-apps/plugin-fs"; import { openUrl } from "@tauri-apps/plugin-opener"; @@ -74,7 +74,10 @@ onMounted(async () => { textScaleListener = await event.listen("text_scale_change", resizeWindow); const isShow = await win.isVisible(); if (!isShow) { - await win.center(); + if (needResize.value) await win.center(); + // TODO: 结合窗口尺寸&放缩以及设计尺寸放置合适位置 + const position = new LogicalPosition(20, 20); + await win.setPosition(position); await win.show(); } if (showFeedback.value) { @@ -485,7 +488,11 @@ async function handleCommands(cmds: CliMatches): Promise { } } -