🚸 处理最大化

This commit is contained in:
BTMuli
2026-02-25 21:50:15 +08:00
parent d2ebcca18a
commit e0a74b0e58
2 changed files with 20 additions and 17 deletions

View File

@@ -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<void> {
@@ -118,6 +118,9 @@ export async function resizeWindow(): Promise<void> {
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);

View File

@@ -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,
},
}),
],
},
},
});