(misc) Add window-shadows for rounded corners on Windows and a shadow on all other platforms

This commit is contained in:
KingRainbow44
2023-11-30 11:47:38 -05:00
parent 3c43ba04e3
commit 3e0ffc19b9
3 changed files with 90 additions and 13 deletions

View File

@@ -2,6 +2,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::fs::create_dir;
use tauri::Manager;
use window_shadows::set_shadow;
mod http;
@@ -22,6 +24,12 @@ fn main() {
.expect("Failed to create app data directory");
}
// Enable window shadows.
let main_window = app.get_window("main")
.expect("Unable to fetch Tauri window.");
#[cfg(any(windows, target_os = "macos"))]
set_shadow(&main_window, true).unwrap();
Ok(())
})
.run(tauri::generate_context!())