Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
feat: add system tray / preference modal;
Browse files Browse the repository at this point in the history
  • Loading branch information
zsmatrix62 committed Mar 6, 2022
1 parent 8c2bc57 commit 2c4428d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src-tauri/src/ui/app.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
use tauri::{App, AppHandle, GlobalShortcutManager, Manager, RunEvent, Wry};

use crate::ui::actions::action_show_app;

pub fn handle_run_events(_app_handle: &AppHandle<Wry>, e: RunEvent) {
pub fn handle_run_events(app_handle: &AppHandle<Wry>, e: RunEvent) {
match e {
RunEvent::Exit => {}
RunEvent::ExitRequested { .. } => {}
RunEvent::CloseRequested { .. } => {}
RunEvent::WindowClosed(_j) => {}
RunEvent::CloseRequested { api, .. } => {
api.prevent_close();
let _ = app_handle.get_window("main").map(|win| {
win.hide();
});
}
RunEvent::WindowClosed(_) => {}
RunEvent::Ready => {}
RunEvent::Resumed => {}
RunEvent::MainEventsCleared => {}
Expand Down
4 changes: 1 addition & 3 deletions src-tauri/src/ui/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ impl SystemTrayBuilder {
},
SystemTrayEvent::LeftClick { .. } => {}
SystemTrayEvent::RightClick { .. } => {}
SystemTrayEvent::DoubleClick { .. } => {
action_show_app(app_handler);
}
SystemTrayEvent::DoubleClick { .. } => {}
_ => {}
}
}
Expand Down

0 comments on commit 2c4428d

Please sign in to comment.