feat: Open main window on tray icon click (Windows)
Implemented functionality to open the main application window when the system tray icon is left-clicked on Windows. This is achieved by adding a handler for `SystemTrayEvent::LeftClick` in `src-tauri/src/main.rs`. The handler ensures the main window is shown and brought into focus. This change is specific to the Windows platform.
This commit is contained in:
parent
1a1b58a528
commit
9025e3c048
@ -945,6 +945,12 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
SystemTrayEvent::LeftClick { .. } => {
|
||||||
|
let window = app.get_window("main").unwrap();
|
||||||
|
window.show().unwrap();
|
||||||
|
window.set_focus().unwrap();
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
})
|
})
|
||||||
.on_window_event(|event| {
|
.on_window_event(|event| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user