Skip to content

Commit

Permalink
add window shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
metkm committed Jul 24, 2022
1 parent 4a75922 commit e4cbcd4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -37,6 +39,13 @@ async fn get_token() -> Option<String> {

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");
Expand Down

0 comments on commit e4cbcd4

Please sign in to comment.