Create webview window in rust

This commit is contained in:
Lncvrt committed 2025-07-29 16:07:59 -07:00
1 parent 59e4748a64
commit 47849529f2
2 files changed
+11 -21

No files matched your search

+10 -8
View File
@@ -1,4 +1,4 @@
use tauri::{Manager, PhysicalSize};
use tauri::Manager;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
@@ -11,13 +11,15 @@ pub fn run() {
}))
.invoke_handler(tauri::generate_handler![])
.setup(|app| {
let window = app.get_webview_window("main").unwrap();
let mut url = window.url().unwrap();
url.set_path("/projectmanager.html");
window.navigate(url).unwrap();
window.set_resizable(false).unwrap();
window.set_size(PhysicalSize::new(800, 500)).unwrap();
window.set_title("Project Manager").unwrap();
tauri::webview::WebviewWindowBuilder::new(
app,
"main",
tauri::WebviewUrl::App("projectmanager.html".into()),
)
.resizable(false)
.title("Code Fly")
.inner_size(800.0, 500.0)
.build()?;
Ok(())
})
.run(tauri::generate_context!())