chore: tray hotkey (#6373)

This commit is contained in:
AetherWing 2026-03-01 17:13:42 +08:00 committed by GitHub
parent 25a83388bb
commit 09ea979cf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -19,5 +19,6 @@
- 隐藏日志中的订阅信息
- 优化部分界面文案文本
- 优化切换节点时的延迟
- 优化托盘退出快捷键显示
</details>

View File

@ -834,7 +834,12 @@ async fn create_tray_menu(
],
)?;
let quit = &MenuItem::with_id(app_handle, MenuIds::EXIT, &texts.exit, true, Some("CmdOrControl+Q"))?;
let quit_accelerator = hotkeys.get("quit").map(|s| s.as_str());
#[cfg(target_os = "macos")]
let quit_accelerator = quit_accelerator.or(Some("Cmd+Q"));
let quit = &MenuItem::with_id(app_handle, MenuIds::EXIT, &texts.exit, true, quit_accelerator)?;
let separator = &PredefinedMenuItem::separator(app_handle)?;