diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index ebf31f3..0e95c84 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -14,9 +14,9 @@ const Layout: React.FC = ({ children }) => { return (
-
+
{!isEditorPage && } -
+
{children}
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx index c25fd6b..c3cc108 100644 --- a/src/components/TitleBar.tsx +++ b/src/components/TitleBar.tsx @@ -1,20 +1,60 @@ -import React from 'react' -import { Minimize2, Maximize2, X } from 'lucide-react' +import React, { useState, useEffect } from 'react' +import { Minimize2, Maximize2, Square, X } from 'lucide-react' +import { getCurrentWindow } from '@tauri-apps/api/window' const TitleBar: React.FC = () => { - const handleMinimize = () => { - // TODO: Implement minimize functionality with Tauri - console.log('Minimize window') + const [isMaximized, setIsMaximized] = useState(false) + + useEffect(() => { + const checkMaximized = async () => { + const window = getCurrentWindow() + const maximized = await window.isMaximized() + setIsMaximized(maximized) + } + + checkMaximized() + + // Listen for window resize events + const unlisten = getCurrentWindow().listen('tauri://resize', () => { + checkMaximized() + }) + + return () => { + unlisten.then(fn => fn()) + } + }, []) + + const handleMinimize = async () => { + try { + const window = getCurrentWindow() + await window.minimize() + } catch (error) { + console.error('Failed to minimize window:', error) + } } - const handleMaximize = () => { - // TODO: Implement maximize functionality with Tauri - console.log('Maximize window') + const handleMaximize = async () => { + try { + const window = getCurrentWindow() + if (isMaximized) { + await window.unmaximize() + setIsMaximized(false) + } else { + await window.maximize() + setIsMaximized(true) + } + } catch (error) { + console.error('Failed to toggle maximize window:', error) + } } - const handleClose = () => { - // TODO: Implement close functionality with Tauri - console.log('Close window') + const handleClose = async () => { + try { + const window = getCurrentWindow() + await window.close() + } catch (error) { + console.error('Failed to close window:', error) + } } return ( @@ -40,7 +80,7 @@ const TitleBar: React.FC = () => { onClick={handleMaximize} className="w-6 h-6 flex items-center justify-center hover:bg-secondary-700 rounded transition-colors" > - + {isMaximized ? : }
-
+
{/* Media Library Sidebar */} diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index fc1cba6..3a8dd67 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -155,6 +155,64 @@ const HomePage: React.FC = () => {
+ + {/* Additional Content for Testing Scroll */} +
+

更多功能

+ +
+
+

视频效果

+
    +
  • • 滤镜和颜色调整
  • +
  • • 转场效果
  • +
  • • 动画和运动图形
  • +
  • • 绿幕抠像
  • +
  • • 画中画效果
  • +
+
+ +
+

音频功能

+
    +
  • • 降噪和音频修复
  • +
  • • 音频均衡器
  • +
  • • 音频同步
  • +
  • • 语音识别
  • +
  • • 音频可视化
  • +
+
+ +
+

导出选项

+
    +
  • • 多种格式支持
  • +
  • • 自定义分辨率
  • +
  • • 批量导出
  • +
  • • 云端渲染
  • +
  • • 直播推流
  • +
+
+ +
+

协作功能

+
    +
  • • 团队协作
  • +
  • • 版本控制
  • +
  • • 评论和反馈
  • +
  • • 云端同步
  • +
  • • 权限管理
  • +
+
+
+
+ + {/* Footer */} +
+

+ © 2025 MixVideo V2. 专业视频编辑软件,让创作更简单。 +

+
) }