From 01aad9cb274dd6876dff150b2341abe880343a64 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 17 Oct 2024 17:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 9 ++++-- .../Meeting/ChatSmallWindow/index.module.scss | 29 +++++++++++++++++-- src/page/Meeting/ChatSmallWindow/index.tsx | 12 ++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 5054c0f..8a06cc8 100644 --- a/main.js +++ b/main.js @@ -357,8 +357,13 @@ app.on('ready', () => { }); // 设置子窗口 ipcMain.handle('setChildWindow', (event, config) => { - if (config.key === 'shareScreenWindow') { - childWindow[config.key].setBounds({ width: config.width }) + switch (config.key) { + case 'shareScreenWindow': + childWindow[config.key].setBounds({ width: config.width }) + break; + case 'chatSmallWindow': + childWindow[config.key].setBounds({ height: config.height }) + break; } }); // 隐藏主窗口 diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index 369294c..5f5f3e9 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -4,14 +4,16 @@ display: flex; flex-direction: column; height: 100%; + position: relative; >div:nth-child(1) { flex-grow: 1; overflow-y: hidden; max-height: 80%; - padding: 4px; + padding: 0 4px; box-sizing: border-box; display: flex; + background-color: rgba(40, 40, 44, .4); flex-direction: column-reverse; .chatSmallWindowContentLeft { @@ -24,7 +26,7 @@ padding: 4px; box-sizing: border-box; border-radius: 0 15px 15px 15px; - margin: 0 0 10px 0; + margin: 0 0 4px 0; font-size: 12px; display: flex; @@ -50,7 +52,7 @@ padding: 4px; box-sizing: border-box; border-radius: 15px 0 15px 15px; - margin: 0 0 10px 0; + margin: 0 0 4px 0; font-size: 14px; display: flex; flex-direction: row-reverse; @@ -70,4 +72,25 @@ opacity: 1; } } + + >div:nth-child(3) { + position: absolute; + left: 50%; + top: 0px; + transform: translate(-50%, 0); + display: flex; + align-items: center; + margin: 0 auto; + background-color: rgba(40, 40, 44, .2); + padding: 0 6px; + cursor: pointer; + + &:hover { + background-color: rgba(40, 40, 44, 1); + } + + >span { + font-size: 12px; + } + } } \ No newline at end of file diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 329dff1..c62f53b 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -1,9 +1,11 @@ import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' +import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons'; import { Input } from 'antd'; import { useEffect, useState } from "react"; const ChatSmallWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') const [chatLists, setChatLists] = useState([]) + const [isExpand, setIsExpand] = useState(false) const channel = new BroadcastChannel('meeting_channel'); useEffect(() => { let time: NodeJS.Timeout; @@ -83,6 +85,16 @@ const ChatSmallWindow: React.FC = () => { } /> +
{ + setIsExpand(!isExpand) + window.electron.setChildWindow({ + height: isExpand ? 150 : 150 / 2, + key: 'chatSmallWindow', + }) + }}> + {isExpand ? '展开' : '收起'} + {isExpand ? : } +
)