feat(windows): Phase 7 C1 — 托盘菜单增强 + 单实例激活现有窗口
- 托盘菜单加 4 项:New messages: N(灰)/ Pause notifications(勾选态)/ Settings.../ Restart connection - 单实例:第二次启动通过 RegisterWindowMessageW 发激活请求,托盘 WndProc 收后调用 on_open(show+reset counter);main.rs AlreadyRunning 路径调用 activate_existing_instance - AppConfig 加 notifications_paused 字段(与 desktop_notifications 区分,tray 暂停持久化) - WS drain 通过 Rc<RefCell<Option<Arc<TrayState>>>> 与托盘共享 new_messages 计数器 - WndProc 在调用 on_open 前自己清零计数器,免去回调侧的 RefCell 捕获(保持 Send+Sync)
This commit is contained in:
@@ -19,6 +19,7 @@ pub struct ActiveConfig {
|
||||
pub sound: bool,
|
||||
pub notify_high: bool,
|
||||
pub notify_max: bool,
|
||||
pub notifications_paused: bool,
|
||||
pub start_with_windows: bool,
|
||||
pub start_minimized: bool,
|
||||
pub close_to_tray: bool,
|
||||
@@ -46,6 +47,7 @@ impl ActiveConfig {
|
||||
sound: p.sound,
|
||||
notify_high: p.notify_high,
|
||||
notify_max: p.notify_max,
|
||||
notifications_paused: p.notifications_paused,
|
||||
start_with_windows: p.start_with_windows,
|
||||
start_minimized: p.start_minimized,
|
||||
close_to_tray: p.close_to_tray,
|
||||
|
||||
Reference in New Issue
Block a user