diff --git a/package.json b/package.json index 4ed99f0..e95de35 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@tauri-apps/plugin-fs": "~2.0.2", "@tauri-apps/plugin-global-shortcut": "~2", "@tauri-apps/plugin-os": "~2", + "@tauri-apps/plugin-positioner": "~2", "@tauri-apps/plugin-shell": "^2.0.1", "@tauri-apps/plugin-store": "~2", "@vueuse/core": "^11.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a54890..aeb70c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@tauri-apps/plugin-os': specifier: ~2 version: 2.0.0 + '@tauri-apps/plugin-positioner': + specifier: ~2 + version: 2.0.1 '@tauri-apps/plugin-shell': specifier: ^2.0.1 version: 2.0.1 @@ -773,6 +776,9 @@ packages: '@tauri-apps/plugin-os@2.0.0': resolution: {integrity: sha512-M7hG/nNyQYTJxVG/UhTKhp9mpXriwWzrs9mqDreB8mIgqA3ek5nHLdwRZJWhkKjZrnDT4v9CpA9BhYeplTlAiA==} + '@tauri-apps/plugin-positioner@2.0.1': + resolution: {integrity: sha512-qZY3qiFnt4XU7pYiew17pso9Wg+lgfr6UBva4uvAuWaeW+6KaZCrGJKyr6GLHDar/Lc5KQV392jKMswfrwOplw==} + '@tauri-apps/plugin-shell@2.0.1': resolution: {integrity: sha512-akU1b77sw3qHiynrK0s930y8zKmcdrSD60htjH+mFZqv5WaakZA/XxHR3/sF1nNv9Mgmt/Shls37HwnOr00aSw==} @@ -2876,6 +2882,10 @@ snapshots: dependencies: '@tauri-apps/api': 2.1.1 + '@tauri-apps/plugin-positioner@2.0.1': + dependencies: + '@tauri-apps/api': 2.1.1 + '@tauri-apps/plugin-shell@2.0.1': dependencies: '@tauri-apps/api': 2.1.1 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 4cc9db4..5d3915d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -965,6 +965,7 @@ dependencies = [ "tauri-plugin-fs", "tauri-plugin-global-shortcut", "tauri-plugin-os", + "tauri-plugin-positioner", "tauri-plugin-shell", "tauri-plugin-store", "tracing", @@ -4721,6 +4722,21 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "tauri-plugin-positioner" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "647253ed516eb1dc5a7eefbfadf594ea5ec9cd8b506ef8896ed64621f9f1d264" +dependencies = [ + "log", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "thiserror 1.0.69", +] + [[package]] name = "tauri-plugin-shell" version = "2.0.2" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 77e3622..78192b7 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -51,6 +51,7 @@ custom-protocol = ["tauri/custom-protocol"] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-autostart = "2" tauri-plugin-global-shortcut = "2" +tauri-plugin-positioner = { version = "2.0.0", features = ["tray-icon"] } [target."cfg(target_os = \"macos\")".dependencies] cocoa = "0.25" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 390413c..d302e09 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -10,6 +10,8 @@ "core:event:allow-emit", "core:event:allow-emit-to", "core:event:allow-listen", - "core:event:allow-unlisten" + "core:event:allow-unlisten", + "positioner:allow-move-window", + "positioner:allow-set-tray-icon-state" ] } \ No newline at end of file diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 320ef16..5ebcc38 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -13,7 +13,7 @@ mod window; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() - .plugin(tauri_plugin_updater::Builder::new().build()) + .plugin(tauri_plugin_positioner::init()) .plugin(tauri_plugin_os::init()) .setup(|app| { #[cfg(desktop)] diff --git a/src-tauri/src/menu.rs b/src-tauri/src/menu.rs index 03e1df5..a7cf900 100644 --- a/src-tauri/src/menu.rs +++ b/src-tauri/src/menu.rs @@ -148,6 +148,7 @@ pub fn get_app_menu(app: &AppHandle) -> Result