Add Splashscreen

This commit is contained in:
Prayag Prajapati committed 2023-02-21 22:33:11 +05:30
1 parent 57cc216ae8
commit 355bbcdbe3
9 files changed
+464 -33

No files matched your search

+14
View File
@@ -3,8 +3,22 @@
windows_subsystem = "windows"
)]
use tauri::Manager;
// Create the command:
// This command must be async so that it doesn't run on the main thread.
#[tauri::command]
async fn close_splashscreen(window: tauri::Window) {
// Close splashscreen
if let Some(splashscreen) = window.get_window("splashscreen") {
splashscreen.close().unwrap();
}
// Show main window
window.get_window("main").unwrap().show().unwrap();
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![close_splashscreen])
.plugin(tauri_plugin_store::Builder::default().build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
+12 -1
View File
@@ -57,9 +57,20 @@
{
"fullscreen": false,
"height": 600,
"width": 800,
"resizable": true,
"title": "JellyPlayer",
"width": 800
"visible": false,
"center": true
},
{
"width": 800,
"height": 600,
"center": true,
"decorations": false,
"resizable": false,
"url": "splash.html",
"label": "splashscreen"
}
]
}