linux-rust: fix conv-detect toggle in tray menu

This commit is contained in:
Kavish Devar
2025-10-21 19:14:38 +05:30
parent b0561e96df
commit 0f04290fba

View File

@@ -110,14 +110,16 @@ impl ksni::Tray for MyTray {
activate: Box::new(|this: &mut Self| { activate: Box::new(|this: &mut Self| {
if let Some(tx) = &this.command_tx { if let Some(tx) = &this.command_tx {
if let Some(is_enabled) = this.conversation_detect_enabled { if let Some(is_enabled) = this.conversation_detect_enabled {
let value = if is_enabled { 0x02 } else { 0x01 }; let new_state = !is_enabled;
let value = if !new_state { 0x02 } else { 0x01 };
let _ = tx.send((ControlCommandIdentifiers::ConversationDetectConfig, vec![value])); let _ = tx.send((ControlCommandIdentifiers::ConversationDetectConfig, vec![value]));
this.conversation_detect_enabled = Some(new_state);
} }
} }
}), }),
..Default::default() ..Default::default()
} }
.into(), .into(),
StandardItem { StandardItem {
label: "Exit".into(), label: "Exit".into(),
icon_name: "application-exit".into(), icon_name: "application-exit".into(),