- 优化关闭图标

This commit is contained in:
Pine
2026-05-14 15:39:12 +08:00
parent af326571da
commit 4821758b03
+6
View File
@@ -46,6 +46,12 @@ pub fn run() {
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
Some(vec![]),
))
.on_window_event(|window, event| {
if let tauri::WindowEvent::CloseRequested { api, .. } = event {
api.prevent_close();
let _ = window.minimize();
}
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}