diff --git a/package-lock.json b/package-lock.json index fe70aae..6719e1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "brancato", - "version": "0.5.0", + "version": "0.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "brancato", - "version": "0.5.0", + "version": "0.6.0", "dependencies": { "@algolia/autocomplete-js": "^1.5.3", "@algolia/autocomplete-theme-classic": "^1.5.3", diff --git a/package.json b/package.json index 521caa4..c9896ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "brancato", - "version": "0.5.0", + "version": "0.6.0", "private": true, "dependencies": { "@algolia/autocomplete-js": "^1.5.3", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index f9586e0..33cb572 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -274,7 +274,7 @@ dependencies = [ [[package]] name = "brancato" -version = "0.5.0" +version = "0.6.0" dependencies = [ "directories", "execute", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 0e2ffb8..f74a681 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "brancato" -version = "0.5.0" +version = "0.6.0" description = "A tool for stage-managing your life" authors = ["Ryan Killeen"] license = "" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 403b026..95a6f80 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -157,29 +157,14 @@ fn main() { let app_config = app_config::get_or_create_app_config(); let user_config = user_config::get_user_config(app_config.user_config_path.clone()); - let quit = CustomMenuItem::new("quit", "Quit"); - let hide = CustomMenuItem::new("hide", "Hide"); - let settings = CustomMenuItem::new("settings", "Settings"); - let tray_menu = SystemTrayMenu::new() - .add_item(quit) - .add_native_item(SystemTrayMenuItem::Separator) - .add_item(settings) - .add_native_item(SystemTrayMenuItem::Separator) - .add_item(hide); - let system_tray = SystemTray::new().with_menu(tray_menu); let app = tauri::Builder::default() - .system_tray(system_tray) + .system_tray(SystemTray::new()) .on_system_tray_event(|app, event| match event { SystemTrayEvent::LeftClick { position: _, size: _, .. } => { - // tauri::window::WindowBuilder::new( - // app, - // "settings", - // tauri::WindowUrl::App("/settings".into()), - // ); focus_window(app, "settings".to_owned()).ok(); } @@ -219,6 +204,28 @@ fn main() { set_shortcut, set_user_config_path ]) + .setup(|app_handle| { + let tray_menu = SystemTrayMenu::new() + .add_item(CustomMenuItem::new("quit", "Quit")) + .add_item(CustomMenuItem::new("settings", "Settings")) + .add_item(CustomMenuItem::new("hide", "Hide")) + .add_native_item(SystemTrayMenuItem::Separator) + .add_item( + CustomMenuItem::new( + "version", + format!( + "Version {version}", + version = &app_handle.package_info().version + ), + ) + .disabled(), + ); + app_handle + .tray_handle() + .set_menu(tray_menu) + .expect("Set the tray damn it"); + Ok(()) + }) .build(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9e8130b..a5b9d9f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "brancato", - "version": "0.5.0" + "version": "0.6.0" }, "build": { "distDir": "../build",