Merge branch 'dev' of https://github.com/tw93/pake into dev

This commit is contained in:
Tw93
2023-04-06 22:31:11 +08:00
2 changed files with 6 additions and 1 deletions

View File

@@ -58,6 +58,6 @@ impl PakeConfig {
#[cfg(not(target_os = "macos"))]
pub fn show_system_tray(&self) -> bool {
self.menu.copied()
self.system_tray.copied()
}
}

View File

@@ -6,6 +6,9 @@ use tauri::{CustomMenuItem, Menu, Submenu, WindowMenuEvent};
#[cfg(any(target_os = "linux", target_os = "windows"))]
use tauri::{Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowUrl};
#[cfg(any(target_os = "linux", target_os = "windows"))]
use tauri_plugin_window_state::{AppHandleExt, StateFlags};
pub fn get_menu() -> Menu {
let close = CustomMenuItem::new("close".to_string(), "Close Window").accelerator("CmdOrCtrl+W");
let first_menu = Menu::new()
@@ -83,6 +86,8 @@ pub fn system_tray_handle(app: &tauri::AppHandle, event: SystemTrayEvent) {
.unwrap();
}
"quit" => {
let _res = app.save_window_state(StateFlags::all());
// println!("save windows state result {:?}", _res);
std::process::exit(0);
}
"about" => {