diff --git a/frontend/src/App.css b/frontend/src/App.css index a01294d..4c0593d 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -2,11 +2,18 @@ .app-container { display: flex; + flex-direction: column; width: 100vw; height: 100vh; overflow: hidden; } +.app-body { + display: flex; + flex: 1; + overflow: hidden; +} + .main-content { flex: 1; height: 100%; @@ -32,6 +39,7 @@ transition: margin-left 0.3s ease, width 0.3s ease, opacity 0.3s ease; overflow: hidden; flex-shrink: 0; + height: 100%; } .sidebar.hidden { @@ -39,27 +47,6 @@ opacity: 0; } -.logo-area { - padding: 16px 20px; - display: flex; - align-items: center; - gap: 12px; - border-bottom: 1px solid var(--border-color); - min-height: 65px; -} - -.logo-area img { - width: 64px; - height: 64px; -} - -.logo-area h1 { - font-size: 1.1rem; - font-weight: 600; - margin: 0; - white-space: nowrap; -} - .nav-scroll-area { flex: 1; overflow-y: auto; @@ -189,6 +176,100 @@ color: var(--text-primary); } +/* Title Bar Styles */ +.titlebar { + display: flex; + align-items: center; + justify-content: space-between; + background-color: var(--cds-layer); + border-bottom: 1px solid var(--border-color); + height: 38px; + min-height: 38px; + flex-shrink: 0; + -webkit-app-region: drag; + user-select: none; +} + +.titlebar.macos { + padding-left: 80px; +} + +.titlebar.other-platform { + padding: 0 8px; +} + +.titlebar-left, +.titlebar-right { + display: flex; + align-items: center; + gap: 4px; + -webkit-app-region: no-drag; +} + +.titlebar-center { + flex: 1; + display: flex; + align-items: center; + justify-content: center; +} + +.titlebar-appname { + font-size: 14px; + font-weight: 500; + color: var(--cds-text-primary); + letter-spacing: 0.2px; +} + +.titlebar-sidebar-toggle { + margin-right: 4px; +} + +/* Window controls for non-macOS platforms */ +.window-controls { + display: flex; + align-items: center; + gap: 2px; +} + +.window-control-btn { + padding: 4px; + border-radius: 4px; + transition: all 0.2s ease; +} + +.window-control-btn:hover { + background-color: var(--cds-layer-hover); +} + +.window-control-btn.close:hover { + background-color: #ff5f57; + color: white; +} + +/* Titlebar settings */ +.titlebar-settings { + margin-right: 4px; +} + +/* Update main-content to account for title bar */ +.main-content { + flex: 1; + height: 100%; + overflow: auto; + position: relative; + background-color: var(--bg-color); + transition: margin-left 0.3s ease; + display: flex; + flex-direction: column; +} + +.content-area { + flex: 1; + overflow-y: auto; + padding: 24px; + margin-top: 0; +} + /* Tool Container and Panes (Same as before) */ .tool-container { max-width: 1400px; diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index f9cee85..6727ac5 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,8 +1,8 @@ import React, { useState, useEffect } from 'react'; import './App.css'; import { Sidebar } from './components/Sidebar'; -import { Theme, IconButton, OverflowMenu, OverflowMenuItem } from '@carbon/react'; -import { Settings } from '@carbon/icons-react'; +import { TitleBar } from './components/TitleBar'; +import { Theme } from '@carbon/react'; // Tools Imports import DateTimeConverter from './pages/DateTimeConverter'; @@ -119,83 +119,26 @@ function App() {
- - -
- {/* Top Bar Area for Toggle & Settings */} -
-
- {!isSidebarOpen && ( - - - - - - - - )} -
- -
- - setThemeMode('system')} requireTitle /> - setThemeMode('dark')} requireTitle /> - setThemeMode('light')} requireTitle /> - + +
+ + +
+
+ {renderTool()}
-
- - -
- {renderTool()} -
-
- - {isSidebarOpen && ( -
- - - - - -
- )} + +
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index a55c28e..564830a 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -1,7 +1,6 @@ import React, { useState, useEffect } from 'react'; -import logo from '../assets/images/logo-universal.png'; -export function Sidebar({ activeTool, setActiveTool, isVisible, toggleSidebar }) { +export function Sidebar({ activeTool, setActiveTool, isVisible }) { const [searchTerm, setSearchTerm] = useState(''); const [pinned, setPinned] = useState(() => { try { @@ -52,18 +51,22 @@ export function Sidebar({ activeTool, setActiveTool, isVisible, toggleSidebar }) return (
-
- Logo -

DevToolbox

-
- -
+ {/* Search bar at the top */} +
setSearchTerm(e.target.value)} - style={{ width: '100%', padding: '6px 10px', fontSize: '13px', backgroundColor: 'rgba(0,0,0,0.2)', border: '1px solid var(--border-color)' }} + style={{ + width: '100%', + padding: '8px 12px', + fontSize: '13px', + backgroundColor: 'var(--cds-field)', + border: '1px solid var(--border-color)', + borderRadius: '4px', + color: 'var(--cds-text-primary)' + }} />
@@ -134,3 +137,5 @@ export function Sidebar({ activeTool, setActiveTool, isVisible, toggleSidebar })
); } + +export default Sidebar; diff --git a/frontend/src/components/TitleBar.jsx b/frontend/src/components/TitleBar.jsx new file mode 100644 index 0000000..c7cd89e --- /dev/null +++ b/frontend/src/components/TitleBar.jsx @@ -0,0 +1,118 @@ +import React from 'react'; +import { IconButton, OverflowMenu, OverflowMenuItem } from '@carbon/react'; +import { Menu, Close, Subtract, Maximize, Settings } from '@carbon/icons-react'; + +export function TitleBar({ + isSidebarOpen, + toggleSidebar, + appName = 'DevToolbox', + themeMode, + setThemeMode +}) { + // Detect if running in desktop mode + const isDesktop = typeof window !== 'undefined' && window.wails; + + // Detect platform + const userAgent = navigator.userAgent.toLowerCase(); + const isMac = userAgent.includes('mac') && !userAgent.includes('iphone') && !userAgent.includes('ipad'); + + // Don't render in browser mode + if (!isDesktop) { + return null; + } + + // Window control handlers for non-macOS platforms + const handleMinimize = () => { + if (window.wails?.WindowMinimise) { + window.wails.WindowMinimise(); + } + }; + + const handleMaximize = () => { + if (window.wails?.WindowMaximise) { + window.wails.WindowMaximise(); + } + }; + + const handleClose = () => { + if (window.wails?.Quit) { + window.wails.Quit(); + } + }; + + return ( +
+ {/* Left section - Sidebar toggle (always visible on desktop) */} +
+ + + +
+ + {/* Center section - App name */} +
+ {appName} +
+ + {/* Right section - Settings + Window controls */} +
+ {/* Settings menu */} + + setThemeMode('system')} requireTitle /> + setThemeMode('dark')} requireTitle /> + setThemeMode('light')} requireTitle /> + + + {/* Window controls for non-macOS platforms */} + {!isMac && ( +
+ + + + + + + + + +
+ )} +
+
+ ); +} + +export default TitleBar;