diff --git a/src/App.tsx b/src/App.tsx index 702233a..c8dbf2b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,10 +3,11 @@ import React, { useState, useEffect, useMemo, useRef } from 'react'; import Clock from './components/Clock'; import SearchBox from './components/SearchBox'; import SettingsModal from './components/SettingsModal'; +import SettingsMenu from './components/SettingsMenu'; import ErrorBoundary from './components/ErrorBoundary'; import GlobalContextMenu from './components/GlobalContextMenu'; import { SettingsIcon } from './components/Icons'; -import { UserSettings, WallpaperFit } from './types'; +import { UserSettings, WallpaperFit, SettingsSection } from './types'; import { PRESET_WALLPAPERS, SEARCH_ENGINES, THEMES } from './constants'; import { loadSettings, saveSettings } from './utils/storage'; import { I18nProvider } from './i18n'; @@ -21,6 +22,7 @@ const DEFAULT_SETTINGS: UserSettings = { themeColor: THEMES[0].hex, searchOpacity: 0.8, enableMaskBlur: false, + maskOpacity: 0.2, backgroundUrl: PRESET_WALLPAPERS[0].url, backgroundType: PRESET_WALLPAPERS[0].type, wallpaperFit: 'cover', @@ -35,6 +37,8 @@ type ViewMode = 'search' | 'dashboard'; const App: React.FC = () => { // State for settings visibility const [isSettingsOpen, setIsSettingsOpen] = useState(false); + const [isSettingsMenuOpen, setIsSettingsMenuOpen] = useState(false); + const [activeSettingsSection, setActiveSettingsSection] = useState('general'); // State for view mode (Search Panel vs Dashboard Panel) const [viewMode, setViewMode] = useState('search'); @@ -100,7 +104,7 @@ const App: React.FC = () => { const handleSelectEngine = (name: string) => { setSettings(prev => ({ ...prev, selectedEngine: name })); }; - + const handleUpdateHistory = (newHistory: string[]) => { setSettings(prev => ({ ...prev, searchHistory: newHistory })); }; @@ -157,6 +161,12 @@ const App: React.FC = () => { setSettings(prev => ({ ...prev, language: lang })); }; + const handleSettingsMenuSelect = (section: SettingsSection) => { + setActiveSettingsSection(section); + setIsSettingsMenuOpen(false); + setIsSettingsOpen(true); + }; + return ( @@ -168,123 +178,135 @@ const App: React.FC = () => { {/* Context Menu Global Listener */} - {/* Background Layer */} -
- {settings.backgroundType === 'video' ? ( -