Merge branch 'dev' of https://github.com/tw93/pake into dev
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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" => {
|
||||
|
||||
Reference in New Issue
Block a user