diff --git a/main.js b/main.js index 1186731..9c93c8d 100644 --- a/main.js +++ b/main.js @@ -178,6 +178,9 @@ app.on('ready', () => { case 'minimize': mainWindow.minimize() break; + case 'hide': + mainWindow.hide() + break; } }); // 导出是否全屏 diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index 3ccf8a3..79bb178 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -1,7 +1,7 @@ import styles from '@/components/Operation/index.module.scss' import ImageUrl from '@/utils/package/ImageUrl'; import { useEffect, useState } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; type OperationType = { icon: string; key: OperationKeyType; diff --git a/src/components/QuitTips/index.tsx b/src/components/QuitTips/index.tsx index 52cea03..4eaecdd 100644 --- a/src/components/QuitTips/index.tsx +++ b/src/components/QuitTips/index.tsx @@ -3,7 +3,7 @@ import { storage } from '@/utils'; import { InfoCircleOutlined } from '@ant-design/icons'; import { Button, Checkbox, Modal, Radio } from 'antd'; import { useState, useImperativeHandle, forwardRef } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; const QuitTips = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeModal: () => { @@ -12,7 +12,7 @@ const QuitTips = forwardRef((props: any, ref: any) => { })) const [isCloseModal, setIsCloseModal] = useState(false); const [isTips, setIsTips] = useState(false); - const [optionsValue, setOperation] = useState('minimize'); + const [optionsValue, setOperation] = useState('hide'); return ( <> { { setOperation(e.target.value); }} value={optionsValue}> - 最小化到系统托盘区,不退出程序。 + 最小化到系统托盘区,不退出程序。 退出程序。 diff --git a/src/render.d.ts b/src/render.d.ts index 6e1f479..6d2b279 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -1,7 +1,7 @@ // electron-env.d.ts export interface IElectronAPI { setMainWindowSize: (config: any) => void; - setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize') => void; + setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize' | 'hide') => void; getIsMaximized: () => Promise; setWriteText: (text: string) => void; onQuit: (callBack: Function) => void;