feat: windows support
This commit is contained in:
parent
7a265704e8
commit
5c0034aabd
9 changed files with 242 additions and 31 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue