mirror of
https://github.com/cinnyapp/cinny-desktop.git
synced 2024-12-29 10:56:19 +00:00
feat: implement quit event
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
6f83708511
commit
409fc0cd1a
|
@ -6,6 +6,8 @@
|
||||||
mod menu;
|
mod menu;
|
||||||
mod tray;
|
mod tray;
|
||||||
|
|
||||||
|
use tauri::Manager;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let builder = tauri::Builder::default();
|
let builder = tauri::Builder::default();
|
||||||
|
|
||||||
|
@ -14,7 +16,14 @@ fn main() {
|
||||||
|
|
||||||
let builder = builder
|
let builder = builder
|
||||||
.system_tray(tray::system_tray())
|
.system_tray(tray::system_tray())
|
||||||
.on_system_tray_event(tray::system_tray_handler);
|
.on_system_tray_event(tray::system_tray_handler)
|
||||||
|
.setup(|app| {
|
||||||
|
let handle = app.handle();
|
||||||
|
app.listen_global("quit", move |_| {
|
||||||
|
handle.exit(0);
|
||||||
|
});
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.build(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
|
|
Loading…
Reference in a new issue