调整横竖切换为图标按钮并锁定竖屏尺寸

This commit is contained in:
JSR
2026-03-18 21:07:39 +08:00
parent 224c89f4dd
commit ff29ed5fff
6 changed files with 41 additions and 11 deletions
+12
View File
@@ -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<RwLock<AppState>>>,
) -> Result<(), String> {
if let Some(window) = app.get_webview_window("main") {
window.set_resizable(resizable).map_err(|e| e.to_string())?;
}
Ok(())
}
+1
View File
@@ -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,