- Register .fig and .pen files with desktop bundles - Open associated files on startup and via single-instance handoff - Reuse the existing Tauri file open flow without broad filesystem scopes
20 lines
520 B
Rust
20 lines
520 B
Rust
use tauri::Emitter;
|
|
|
|
#[cfg(debug_assertions)]
|
|
use tauri::Manager;
|
|
|
|
pub fn handle_menu_event<R: tauri::Runtime>(app: &tauri::AppHandle<R>, event_id: &str) {
|
|
#[cfg(debug_assertions)]
|
|
if event_id == "dev-tools" {
|
|
if let Some(window) = app.get_webview_window("main") {
|
|
if window.is_devtools_open() {
|
|
window.close_devtools();
|
|
} else {
|
|
window.open_devtools();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
let _ = app.emit("menu-event", event_id);
|
|
}
|