MCPcopy Create free account
hub / github.com/GCWing/BitFun / toggle_main_window

Function toggle_main_window

src/apps/desktop/src/tray.rs:288–301  ·  view source on GitHub ↗
(app: &tauri::AppHandle)

Source from the content-addressed store, hash-verified

286}
287
288fn toggle_main_window(app: &tauri::AppHandle) {
289 if let Some(window) = app.get_webview_window("main") {
290 let visible = window.is_visible().unwrap_or(false);
291 if visible {
292 let _ = window.hide();
293 log::info!("Main window hidden via tray toggle");
294 } else {
295 let _ = window.show();
296 let _ = window.unminimize();
297 let _ = window.set_focus();
298 log::info!("Main window shown via tray toggle");
299 }
300 }
301}

Callers 1

setup_trayFunction · 0.85

Calls 3

is_visibleMethod · 0.45
hideMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected