feat(splashscreen): implement a splash screen for application startup
This commit introduces a splash screen that enhances the user experience during application startup. It includes a new HTML file for the splash screen layout and a corresponding icon. The main application logic has been updated to close the splash screen once the main application is ready. - Added a splash screen HTML and icon for improved visual feedback - Updated main application logic to manage splash screen visibility - Enhanced title bar branding with an image instead of SVG
This commit is contained in:
+14
-1
@@ -19,6 +19,18 @@ use git::{
|
||||
restore_to_commit, search_code_introductions, stage_files, stash_apply, stash_drop, stash_pop,
|
||||
stash_push, undo_last_commit, unstage_files,
|
||||
};
|
||||
use tauri::Manager;
|
||||
|
||||
#[tauri::command]
|
||||
fn close_splashscreen(app: tauri::AppHandle) {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
if let Some(window) = app.get_webview_window("splashscreen") {
|
||||
let _ = window.close();
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
@@ -97,7 +109,8 @@ async fn main() {
|
||||
cred_load,
|
||||
cred_save,
|
||||
cred_delete,
|
||||
set_sync_badge
|
||||
set_sync_badge,
|
||||
close_splashscreen
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
@@ -18,8 +18,21 @@
|
||||
"height": 800,
|
||||
"minWidth": 900,
|
||||
"minHeight": 600,
|
||||
"visible": false,
|
||||
"decorations": false,
|
||||
"shadow": true
|
||||
},
|
||||
{
|
||||
"label": "splashscreen",
|
||||
"url": "splashscreen.html",
|
||||
"title": "GitLite",
|
||||
"width": 460,
|
||||
"height": 420,
|
||||
"resizable": false,
|
||||
"decorations": false,
|
||||
"center": true,
|
||||
"skipTaskbar": true,
|
||||
"shadow": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
|
||||
Reference in New Issue
Block a user