Update tauri to 2.0rc

This commit is contained in:
cast1e
2024-09-26 16:35:08 +08:00
parent dadec49e49
commit e5882e8532
20 changed files with 5032 additions and 723 deletions
+1064 -563
View File
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -12,14 +12,13 @@ rust-version = "1.60"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5.5", features = [] }
tauri-build = { version = "2.0.0-rc", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.8.0", features = [ "window-minimize", "window-maximize", "window-close", "window-show", "window-hide", "window-start-dragging", "window-unminimize", "window-unmaximize"] }
window-vibrancy = "0.4"
window-shadows = "0.2.2"
tauri = { version = "2.0.0-rc", features = [] }
window-vibrancy = "0.5.2"
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
@@ -0,0 +1,20 @@
{
"identifier": "migrated",
"description": "permissions that were migrated from v1",
"local": true,
"windows": [
"main"
],
"permissions": [
"core:default",
"core:window:allow-maximize",
"core:window:allow-unmaximize",
"core:window:allow-toggle-maximize",
"core:window:allow-minimize",
"core:window:allow-unminimize",
"core:window:allow-show",
"core:window:allow-hide",
"core:window:allow-close",
"core:window:allow-start-dragging"
]
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-toggle-maximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-start-dragging"]}}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -4
View File
@@ -1,11 +1,10 @@
use tauri::{App, Manager};
use window_vibrancy::{self, NSVisualEffectMaterial};
use window_shadows::set_shadow;
/// setup
pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>> {
let win = app.get_window("main").unwrap();
let win = app.get_webview_window("main").unwrap();
// 仅在 macOS 下执行
#[cfg(target_os = "macos")]
window_vibrancy::apply_vibrancy(&win, NSVisualEffectMaterial::FullScreenUI)
@@ -14,8 +13,7 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box<dyn std::error::Error>
// 仅在 windows 下执行
#[cfg(target_os = "windows")]
if let Err(_) = window_vibrancy::apply_mica(&win, None){
window_vibrancy::apply_acrylic(&win, Some((10,10,10,180))).expect("Unsupport Blur Effect!")
window_vibrancy::apply_acrylic(&win, Some((10,10,10,210))).expect("Unsupport Blur Effect!")
}
set_shadow(&win, true).unwrap();
Ok(())
}
+45 -60
View File
@@ -3,77 +3,62 @@
"build": {
"beforeBuildCommand": "npm run build",
"beforeDevCommand": "npm run dev",
"devPath": "http://localhost:5173",
"distDir": "../dist"
"frontendDist": "../dist",
"devUrl": "http://localhost:5173"
},
"package": {
"productName": "wallitor-gui",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": false,
"window": {
"all": false,
"close": true,
"hide": true,
"show": true,
"maximize": true,
"minimize": true,
"unmaximize": true,
"unminimize": true,
"startDragging": true
}
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"targets": "all",
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"linux": {
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.tauri.dev",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null
},
"updater": {
"active": false
},
}
},
"productName": "wallitor-gui",
"mainBinaryName": "wallitor-gui",
"version": "0.1.0",
"identifier": "com.tauri.dev",
"plugins": {},
"app": {
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "wallitor-gui",
"transparent": true,
"width": 800,
"width": 950,
"height": 750,
"decorations": false
}
]
],
"security": {
"csp": null
}
}
}
}