mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-17 17:44:40 +01:00
(misc) Add window-shadows for rounded corners on Windows and a shadow on all other platforms
This commit is contained in:
@@ -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!())
|
||||
|
||||
Reference in New Issue
Block a user