Skip to content

Commit

Permalink
perf: add quit tray menu back
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-jerry committed Oct 23, 2024
1 parent 71869f1 commit b7f245c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use tauri::{
image::Image,
menu::{CheckMenuItem, Menu, MenuItem},
menu::{CheckMenuItem, Menu, MenuItem, PredefinedMenuItem},
tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
AppHandle, Error, Manager, Runtime,
};
Expand Down Expand Up @@ -103,7 +103,9 @@ pub fn build_tray_menu<R: Runtime>(app: &AppHandle<R>) -> Result<Menu<R>, Error>
None::<&str>,
)?;

let tray_menu = Menu::with_items(app, &[&toggle, &open_config_folder, &check_updates])?;
let quit = PredefinedMenuItem::quit(app, Some(&"Quit")).unwrap();

let tray_menu = Menu::with_items(app, &[&toggle, &open_config_folder, &check_updates, &quit])?;

Ok(tray_menu)
}

0 comments on commit b7f245c

Please sign in to comment.