ae56d3685c
* refactor(nc-android): move nc android into mobile/nym-connect rename the android app ID to "nym_connect" * chore(nc-mobile): restore dist directory * fix: typo * chore: restore gitkeep * chore: track Cargo.lock * ci: trigger ts lint workflow on pull request * refactor(nym-connect): new structure move temp mobile version under nym-connect-new/mobile * refactor(nym-connect): new structure move temp desktop version under nym-connect-new/desktop * refactor(nym-connect): new structure rename nym-connect-new to nym-connect * refactor(nym-connect): new structure restore lost .gitkeep * refactor(nym-connect): new structure restore lost .gitkeep * fix(nym-connect-desktop): broken relative paths * fix(nym-connect-mobile): add todo comment about broken deps * ci(nym-connect): fix relative paths * ci(nym-connect): rename workflow
31 lines
940 B
Rust
31 lines
940 B
Rust
use crate::menu::TRAY_MENU_SHOW_HIDE;
|
|
use tauri::{AppHandle, Manager};
|
|
|
|
pub(crate) fn window_hide(app: &AppHandle<tauri::Wry>) {
|
|
let window = app.get_window("main").unwrap();
|
|
let item_handle = app.tray_handle().get_item(TRAY_MENU_SHOW_HIDE);
|
|
if window.is_visible().unwrap() {
|
|
window.hide().unwrap();
|
|
item_handle.set_title("Show").unwrap();
|
|
}
|
|
}
|
|
|
|
pub(crate) fn window_show(app: &AppHandle<tauri::Wry>) {
|
|
let window = app.get_window("main").unwrap();
|
|
let item_handle = app.tray_handle().get_item(TRAY_MENU_SHOW_HIDE);
|
|
if !window.is_visible().unwrap() {
|
|
window.show().unwrap();
|
|
item_handle.set_title("Hide").unwrap();
|
|
window.set_focus().unwrap();
|
|
}
|
|
}
|
|
|
|
pub(crate) fn window_toggle(app: &AppHandle<tauri::Wry>) {
|
|
let window = app.get_window("main").unwrap();
|
|
if window.is_visible().unwrap() {
|
|
window_hide(app);
|
|
} else {
|
|
window_show(app);
|
|
}
|
|
}
|