Create webview window in rust
This commit is contained in:
2 files changed
+11
-21
No files matched your search
+10
-8
@@ -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!())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "PHP Fly",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0",
|
||||
"identifier": "xyz.lncvrt.php-fly",
|
||||
"build": {
|
||||
"beforeDevCommand": "yarn dev",
|
||||
@@ -9,18 +9,6 @@
|
||||
"beforeBuildCommand": "yarn build",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "PHP Fly",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
|
||||
Reference in new issue
Block a user