feat: windows support

This commit is contained in:
Miguel da Mota 2024-01-14 23:16:45 +01:00
parent 7a265704e8
commit 5c0034aabd
9 changed files with 242 additions and 31 deletions

View file

@ -2,10 +2,17 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::Manager;
use window_shadows::set_shadow;
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![close_splashscreen])
.setup(|app| {
let window = app.get_window("main").unwrap();
set_shadow(&window, true).expect("Unsupported platform!");
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
@ -13,6 +20,7 @@ fn main() {
#[tauri::command]
async fn close_splashscreen(window: tauri::Window) {
if let Some(splashscreen) = window.get_window("splashscreen") {
println!("Closing splashscreen");
splashscreen.close().unwrap();
}
window.get_window("main").unwrap().show().unwrap();