diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs index 2b9f6d1..eb7e6ea 100644 --- a/src-tauri/src/commands/window.rs +++ b/src-tauri/src/commands/window.rs @@ -87,3 +87,15 @@ pub async fn window_resize( } Ok(()) } + +#[tauri::command] +pub async fn window_set_resizable( + resizable: bool, + app: AppHandle, + _state: tauri::State<'_, Arc>>, +) -> Result<(), String> { + if let Some(window) = app.get_webview_window("main") { + window.set_resizable(resizable).map_err(|e| e.to_string())?; + } + Ok(()) +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e47aa28..c1c5b30 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -71,6 +71,7 @@ fn main() { window_is_maximized, toggle_devtools, window_resize, + window_set_resizable, db_test_connection, db_switch_connection, db_get_status, diff --git a/src/App.tsx b/src/App.tsx index c44d7c9..282ba2e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -140,10 +140,12 @@ function MainContent(): React.JSX.Element { await api.windowMaximize() } if (nextPortraitMode) { - await api.windowResize(800, 1000) + await api.windowSetResizable(false) + await api.windowResize(940, 1280) setSidebarCollapsed(true) } else { - await api.windowResize(1180, 680) + await api.windowSetResizable(true) + await api.windowResize(1440, 900) setSidebarCollapsed(false) } setIsPortraitMode(nextPortraitMode) diff --git a/src/components/ContentArea.tsx b/src/components/ContentArea.tsx index 698fc75..cf97adc 100644 --- a/src/components/ContentArea.tsx +++ b/src/components/ContentArea.tsx @@ -136,13 +136,6 @@ export function ContentArea({ } > - {permissionTag} {hasAnyPassword && ( <> @@ -156,7 +149,10 @@ export function ContentArea({ )} - + diff --git a/src/components/WindowControls.tsx b/src/components/WindowControls.tsx index f24d01e..6b46380 100644 --- a/src/components/WindowControls.tsx +++ b/src/components/WindowControls.tsx @@ -4,10 +4,19 @@ import { BorderOutlined, CloseOutlined, FullscreenExitOutlined, + SwapOutlined, } from "@ant-design/icons" import { useEffect, useState } from "react" -export function WindowControls(): React.JSX.Element { +interface WindowControlsProps { + isPortraitMode: boolean + onToggleOrientation: () => void +} + +export function WindowControls({ + isPortraitMode, + onToggleOrientation, +}: WindowControlsProps): React.JSX.Element { const [isMaximized, setIsMaximized] = useState(false) useEffect(() => { @@ -74,6 +83,14 @@ export function WindowControls(): React.JSX.Element { > +