From e0a74b0e58335b00aedcb1552b9a21f75b41f2e3 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Wed, 25 Feb 2026 21:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E5=A4=84=E7=90=86=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/TGWindow.ts | 7 +++++-- vite.config.ts | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/utils/TGWindow.ts b/src/utils/TGWindow.ts index 95441fb0..aa489da0 100644 --- a/src/utils/TGWindow.ts +++ b/src/utils/TGWindow.ts @@ -1,6 +1,6 @@ /** * 窗口创建相关工具函数 - * @since Beta v0.9.1 + * @since Beta v0.9.6 */ import type { RenderCard } from "@comp/app/t-postcard.vue"; @@ -101,7 +101,7 @@ export function getWindowSize(label: string): PhysicalSize { /** * 窗口适配 - * @since Beta v0.9.1 + * @since Beta v0.9.6 * @returns 无返回值 */ export async function resizeWindow(): Promise { @@ -118,6 +118,9 @@ export async function resizeWindow(): Promise { const heightScale = screen.size.height / 1080; const targetWidth = Math.round(designSize.width * widthScale); const targetHeight = Math.round(designSize.height * heightScale); + if (await windowCur.isMaximized()) { + await windowCur.unmaximize(); + } await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight)); const targetZoom = Math.min(widthScale, heightScale) / (screen.scaleFactor * textScale); await windowCur.setZoom(targetZoom); diff --git a/vite.config.ts b/vite.config.ts index 7d4964b5..2ebc6d97 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,11 @@ /** * vite 配置文件 - * @since Beta v0.9.1 + * @since Beta v0.9.6 */ import { sentryVitePlugin } from "@sentry/vite-plugin"; import vue from "@vitejs/plugin-vue"; -// import postcssPresetEnv from "postcss-preset-env"; +import postcssPresetEnv from "postcss-preset-env"; import { defineConfig } from "vite"; import VueDevtools from "vite-plugin-vue-devtools"; import vuetify from "vite-plugin-vuetify"; @@ -57,17 +57,17 @@ export default defineConfig({ chunkSizeWarningLimit: 8192, sourcemap: true, }, - // css: { - // postcss: { - // plugins: [ - // postcssPresetEnv({ - // stage: 2, - // features: { - // "color-function": true, - // "cascade-layers": true, - // }, - // }), - // ], - // }, - // }, + css: { + postcss: { + plugins: [ + postcssPresetEnv({ + stage: 2, + features: { + "color-function": true, + "cascade-layers": true, + }, + }), + ], + }, + }, });