build(tauri): 添加操作系统插件并调整窗口配置
- 在 package.json 和 Cargo.toml 中添加 @tauri-apps/plugin-os 依赖 - 在 default.json 中添加 os:default 权限 - 在 lib.rs 中初始化 tauri_plugin_os - 在 tauri.conf.json 中设置 hiddenTitle 为 true 并添加 titleBarStyle 为 Overlay
This commit is contained in:
9
deno.lock
generated
9
deno.lock
generated
@@ -13,6 +13,7 @@
|
|||||||
"npm:@tauri-apps/plugin-dialog@~2.3.1": "2.3.1",
|
"npm:@tauri-apps/plugin-dialog@~2.3.1": "2.3.1",
|
||||||
"npm:@tauri-apps/plugin-fs@~2.4.1": "2.4.1",
|
"npm:@tauri-apps/plugin-fs@~2.4.1": "2.4.1",
|
||||||
"npm:@tauri-apps/plugin-opener@2": "2.4.0",
|
"npm:@tauri-apps/plugin-opener@2": "2.4.0",
|
||||||
|
"npm:@tauri-apps/plugin-os@2.3": "2.3.0",
|
||||||
"npm:@tauri-apps/plugin-store@2.3": "2.3.0",
|
"npm:@tauri-apps/plugin-store@2.3": "2.3.0",
|
||||||
"npm:@types/lodash-es@^4.17.12": "4.17.12",
|
"npm:@types/lodash-es@^4.17.12": "4.17.12",
|
||||||
"npm:clsx@^2.1.1": "2.1.1",
|
"npm:clsx@^2.1.1": "2.1.1",
|
||||||
@@ -1037,6 +1038,13 @@
|
|||||||
],
|
],
|
||||||
"tarball": "https://registry.npmmirror.com/@tauri-apps/plugin-opener/-/plugin-opener-2.4.0.tgz"
|
"tarball": "https://registry.npmmirror.com/@tauri-apps/plugin-opener/-/plugin-opener-2.4.0.tgz"
|
||||||
},
|
},
|
||||||
|
"@tauri-apps/plugin-os@2.3.0": {
|
||||||
|
"integrity": "sha512-dm3bDsMuUngpIQdJ1jaMkMfyQpHyDcaTIKTFaAMHoKeUd+Is3UHO2uzhElr6ZZkfytIIyQtSVnCWdW2Kc58f3g==",
|
||||||
|
"dependencies": [
|
||||||
|
"@tauri-apps/api"
|
||||||
|
],
|
||||||
|
"tarball": "https://registry.npmmirror.com/@tauri-apps/plugin-os/-/plugin-os-2.3.0.tgz"
|
||||||
|
},
|
||||||
"@tauri-apps/plugin-store@2.3.0": {
|
"@tauri-apps/plugin-store@2.3.0": {
|
||||||
"integrity": "sha512-mre8er0nXPhyEWQzWCpUd+UnEoBQYcoA5JYlwpwOV9wcxKqlXTGfminpKsE37ic8NUb2BIZqf0QQ9/U3ib2+/A==",
|
"integrity": "sha512-mre8er0nXPhyEWQzWCpUd+UnEoBQYcoA5JYlwpwOV9wcxKqlXTGfminpKsE37ic8NUb2BIZqf0QQ9/U3ib2+/A==",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
@@ -2399,6 +2407,7 @@
|
|||||||
"npm:@tauri-apps/plugin-dialog@~2.3.1",
|
"npm:@tauri-apps/plugin-dialog@~2.3.1",
|
||||||
"npm:@tauri-apps/plugin-fs@~2.4.1",
|
"npm:@tauri-apps/plugin-fs@~2.4.1",
|
||||||
"npm:@tauri-apps/plugin-opener@2",
|
"npm:@tauri-apps/plugin-opener@2",
|
||||||
|
"npm:@tauri-apps/plugin-os@2.3",
|
||||||
"npm:@tauri-apps/plugin-store@2.3",
|
"npm:@tauri-apps/plugin-store@2.3",
|
||||||
"npm:@types/lodash-es@^4.17.12",
|
"npm:@types/lodash-es@^4.17.12",
|
||||||
"npm:clsx@^2.1.1",
|
"npm:clsx@^2.1.1",
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
"@tauri-apps/plugin-dialog": "~2.3.1",
|
"@tauri-apps/plugin-dialog": "~2.3.1",
|
||||||
"@tauri-apps/plugin-fs": "~2.4.1",
|
"@tauri-apps/plugin-fs": "~2.4.1",
|
||||||
|
"@tauri-apps/plugin-os": "~2.3.0",
|
||||||
"@tauri-apps/plugin-store": "~2.3.0",
|
"@tauri-apps/plugin-store": "~2.3.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
@@ -25,4 +25,5 @@ serde_json = "1"
|
|||||||
tauri-plugin-store = "2"
|
tauri-plugin-store = "2"
|
||||||
tauri-plugin-fs = "2"
|
tauri-plugin-fs = "2"
|
||||||
tauri-plugin-dialog = "2"
|
tauri-plugin-dialog = "2"
|
||||||
|
tauri-plugin-os = "2"
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
"core:window:allow-start-dragging",
|
"core:window:allow-start-dragging",
|
||||||
"store:default",
|
"store:default",
|
||||||
"fs:default",
|
"fs:default",
|
||||||
"dialog:default"
|
"dialog:default",
|
||||||
|
"os:default"
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -7,6 +7,7 @@ fn greet(name: &str) -> String {
|
|||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_os::init())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.plugin(tauri_plugin_store::Builder::new().build())
|
.plugin(tauri_plugin_store::Builder::new().build())
|
||||||
|
@@ -18,7 +18,8 @@
|
|||||||
"minWidth": 1200,
|
"minWidth": 1200,
|
||||||
"minHeight": 800,
|
"minHeight": 800,
|
||||||
"resizable": true,
|
"resizable": true,
|
||||||
"hiddenTitle": false,
|
"hiddenTitle": true,
|
||||||
|
"titleBarStyle": "Overlay",
|
||||||
"theme": "Dark"
|
"theme": "Dark"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user