diff --git a/.gitignore b/.gitignore index f534d76..3a8c28c 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ temp/ src-tauri/temp/ log/ .tauri/ -todo/ \ No newline at end of file +todo/ +next-env.d.ts diff --git a/latest.json b/latest.json deleted file mode 100644 index 96e869b..0000000 --- a/latest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "0.0.6-beta.6", - "notes": "版本 0.0.6-beta.6 更新", - "pub_date": "2025-11-08T14:22:43.761Z", - "platforms": { - "windows-x86_64": { - "url": "https://github.com/plsgo/cstb/releases/download/v0.0.6-beta.6/CS工具箱_0.0.6-beta.6_x64-setup.exe", - "signature": null - } - }, - "download_url": "https://github.com/plsgo/cstb/releases/download/v0.0.6-beta.6/CS工具箱_0.0.6-beta.6_x64-setup.exe", - "signature": null -} \ No newline at end of file diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c..c4b7818 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 06919e2..a8245e5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -52,7 +52,7 @@ }, "productName": "CS工具箱", "mainBinaryName": "cstb", - "version": "0.0.6", + "version": "0.0.7-beta.1", "identifier": "upup.cool", "plugins": { "deep-link": { diff --git a/src/components/cstb/VideoSetting.tsx b/src/components/cstb/VideoSetting.tsx index 6f9f363..89fa6cb 100644 --- a/src/components/cstb/VideoSetting.tsx +++ b/src/components/cstb/VideoSetting.tsx @@ -4,7 +4,7 @@ import { Card, CardBody, CardHeader, CardIcon, CardTool } from "../window/Card" import { ToolButton } from "../window/ToolButton" import { addToast, - NumberInput, + Input, Tab, Tabs, Tooltip, @@ -50,19 +50,30 @@ const VideoSetting = () => { { wait: 500, leading: false, trailing: true } ) const videoSettings = (video: VideoConfig) => { + // 判断当前全屏模式 + const getFullscreenMode = () => { + if (video.fullscreen === "1") { + return "全屏" + } else if (video.coop_fullscreen === "1") { + return "全屏窗口化" + } else { + return "窗口" + } + } + return [ { type: "fullscreen", - title: "全屏", - value: video.fullscreen === "1" ? "全屏" : "窗口", - options: ["窗口", "全屏"], + title: "显示模式", + value: getFullscreenMode(), + options: ["窗口", "全屏", "全屏窗口化"], mapping: (value: string) => { - return ( - { - 窗口: "0", - 全屏: "1", - }[value] || "0" - ) + // 返回一个对象,包含需要同时更新的字段 + return { + 窗口: { fullscreen: "0", coop_fullscreen: "0" }, + 全屏: { fullscreen: "1", coop_fullscreen: "0" }, + 全屏窗口化: { fullscreen: "0", coop_fullscreen: "1" }, + }[value] || { fullscreen: "0", coop_fullscreen: "0" } }, }, { @@ -487,7 +498,7 @@ const VideoSetting = () => { @@ -510,34 +521,41 @@ const VideoSetting = () => { - - { + + { setVconfig({ ...vconfig, - defaultres: value.toString(), + defaultres: val, }) }} radius="full" - step={10} - className="max-w-28" - classNames={{ inputWrapper: "h-10" }} + className="w-20" + classNames={{ + inputWrapper: "h-9 px-3", + }} /> - { + x + { setVconfig({ ...vconfig, - defaultresheight: value.toString(), + defaultresheight: val, }) }} radius="full" - step={10} - className="max-w-28" - classNames={{ inputWrapper: "h-10" }} + className="w-20" + classNames={{ + inputWrapper: "h-9 px-3", + }} /> @@ -545,17 +563,27 @@ const VideoSetting = () => {
  • {vid.title} { if (key) { - setVconfig({ - ...vconfig, - [vid.type]: vid.mapping(key.toString()), - }) + const mappedValue = vid.mapping(key.toString()) + // 如果返回的是对象(如全屏模式),需要同时更新多个字段 + if (typeof mappedValue === "object" && mappedValue !== null) { + setVconfig({ + ...vconfig, + ...mappedValue, + }) + } else { + // 否则只更新单个字段 + setVconfig({ + ...vconfig, + [vid.type]: mappedValue, + }) + } } }} >