diff --git a/main.js b/main.js index 41e02c9..b8d0d61 100644 --- a/main.js +++ b/main.js @@ -62,20 +62,20 @@ function createTray() { label: '打开', click: () => { showWindow() }, - icon: iconPath, + // icon: iconPath, }, { label: '退出', click: () => { app.quit(); mainWindow = null; }, - icon: iconPath, + // icon: iconPath, }, { label: '退出到系统托盘', click: () => { mainWindow.hide(); }, - icon: iconPath, + // icon: iconPath, }, ]); tray.setToolTip('智汇享'); diff --git a/src/assets/icon.png b/src/assets/icon.png index 04fe739..bc823d0 100644 Binary files a/src/assets/icon.png and b/src/assets/icon.png differ diff --git a/src/components/Operation/index.module.scss b/src/components/Operation/index.module.scss index 6a1307b..fb119fe 100644 --- a/src/components/Operation/index.module.scss +++ b/src/components/Operation/index.module.scss @@ -24,4 +24,18 @@ background-color: #880F0F; } } +} + +.isCloseModal { + .isCloseModalContent { + display: flex; + align-items: center; + margin: 10px 0; + } + + .isCloseModalFooter { + display: flex; + align-items: center; + justify-content: space-between; + } } \ No newline at end of file diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index 6f3ef2a..2a29994 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -1,5 +1,8 @@ import styles from '@/components/Operation/index.module.scss' +import { storage } from '@/utils'; import ImageUrl from '@/utils/package/imageUrl'; +import { InfoCircleOutlined } from '@ant-design/icons'; +import { Button, Checkbox, Modal, Radio } from 'antd'; import { useEffect, useState } from "react"; type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize'; type OperationType = { @@ -46,11 +49,17 @@ const Operation: React.FC = () => { key: 'quit', title: '关闭', onClick: (key: OperationKeyType) => { - window.electron.setViewStatus(key) + if (storage.getItem('isTips') === 'true') { + window.electron.setViewStatus(key) + } else { + setIsCloseModal(true) + } }, show: true, },]) - + const [isCloseModal, setIsCloseModal] = useState(false); + const [isTips, setIsTips] = useState(false); + const [optionsValue, setOperation] = useState('minimize'); useEffect(() => { getIsMaximized() const handleResize = () => { @@ -96,6 +105,49 @@ const Operation: React.FC = () => { }) } + setIsCloseModal(false)} + centered + width={'380px'} + > +
+
+ +
+ 您点击了关闭按钮,您是想: + { + setOperation(e.target.value); + }} value={optionsValue}> + 最小化到系统托盘区,不退出程序。 + 退出程序。 + +
+
+
+ { + setIsTips(e.target.checked) + storage.setItem('isTips', e.target.checked) + }} defaultChecked={isTips}>不在提示 +
+ + +
+
+
+
) } diff --git a/src/utils/styles/App.scss b/src/utils/styles/App.scss index 7b95595..37d71b5 100644 --- a/src/utils/styles/App.scss +++ b/src/utils/styles/App.scss @@ -212,7 +212,8 @@ $pagination-hover-background-color: #5575F2; color: black !important; } } - .ant-pagination-item-ellipsis{ + + .ant-pagination-item-ellipsis { color: white !important; } } @@ -297,4 +298,15 @@ $pagination-hover-background-color: #5575F2; .ant-empty-description { color: #808080; } +} + +.ant-radio-group { + .ant-radio-wrapper { + color: white; + } + + .ant-radio-checked .ant-radio-inner { + border-color: $btn-background-color; + background-color: $btn-background-color; + } } \ No newline at end of file