diff --git a/Cargo.lock b/Cargo.lock index 0aec429..8aa22f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,6 +64,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "window-shadows", ] [[package]] @@ -3935,6 +3936,18 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "window-shadows" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "796156ad1a67853e927727809bb6138ddc1f19ebced0dc976c0d109d5e2576f7" +dependencies = [ + "cocoa", + "objc", + "raw-window-handle", + "windows-sys", +] + [[package]] name = "windows" version = "0.37.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index df5b79c..d8ddcd3 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -22,6 +22,7 @@ tauri = { version = "1.0.3", features = ["devtools", "http-request", "process-re reqwest = { version = "0.11.11", features = ["json"] } lazy_static = "1.4.0" regex = "1.6.0" +window-shadows = "0.1.3" [profile.release] panic = "abort" # Strip expensive panic clean-up logic diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 57efe58..a75a83b 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -5,6 +5,8 @@ use lazy_static::lazy_static; use regex::Regex; +use tauri::Manager; +use window_shadows::set_shadow; #[derive(serde::Deserialize, serde::Serialize)] enum TokenError { @@ -37,6 +39,13 @@ async fn get_token() -> Option { fn main() { tauri::Builder::default() + .setup(|app| { + if let Some(window) = app.get_window("main") { + set_shadow(&window, true); + } + + Ok(()) + }) .invoke_handler(tauri::generate_handler![get_token]) .run(tauri::generate_context!()) .expect("error while running tauri application");