add idle timeout and version on settings screen
This commit is contained in:
1 parent
69f6a39396
commit
141334f7e2
9 files changed
+149
-17
No files matched your search
+12
-4
@@ -1,12 +1,15 @@
|
||||
use tauri::{
|
||||
AppHandle,
|
||||
CustomMenuItem,
|
||||
Manager,
|
||||
SystemTray,
|
||||
SystemTrayEvent,
|
||||
SystemTrayMenu,
|
||||
CustomMenuItem,
|
||||
async_runtime as rt,
|
||||
};
|
||||
|
||||
use crate::app;
|
||||
use crate::state::AppState;
|
||||
|
||||
|
||||
pub fn create() -> SystemTray {
|
||||
@@ -21,13 +24,18 @@ pub fn create() -> SystemTray {
|
||||
}
|
||||
|
||||
|
||||
pub fn handle_event(app: &AppHandle, event: SystemTrayEvent) {
|
||||
pub fn handle_event(app_handle: &AppHandle, event: SystemTrayEvent) {
|
||||
match event {
|
||||
SystemTrayEvent::MenuItemClick{ id, .. } => {
|
||||
match id.as_str() {
|
||||
"exit" => app.exit(0),
|
||||
"exit" => app_handle.exit(0),
|
||||
"show_hide" => {
|
||||
let _ = app::toggle_main_window(app);
|
||||
let _ = app::toggle_main_window(app_handle);
|
||||
let new_handle = app_handle.app_handle();
|
||||
rt::spawn(async move {
|
||||
let state = new_handle.state::<AppState>();
|
||||
state.signal_activity().await;
|
||||
});
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user