mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-13 13:30:31 +08:00
fix(tray): correct spelling of 'TrayMenu' in TrayAction enum and usage
This commit is contained in:
parent
b17dd39f31
commit
95281632a1
@ -55,7 +55,7 @@ pub(crate) enum TrayAction {
|
||||
SystemProxy,
|
||||
TunMode,
|
||||
MainWindow,
|
||||
TrayMenue,
|
||||
TrayMenu,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ impl From<&str> for TrayAction {
|
||||
"system_proxy" => Self::SystemProxy,
|
||||
"tun_mode" => Self::TunMode,
|
||||
"main_window" => Self::MainWindow,
|
||||
"tray_menue" => Self::TrayMenue,
|
||||
"tray_menu" => Self::TrayMenu,
|
||||
_ => Self::Unknown,
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ impl Tray {
|
||||
.tray_by_id("main")
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to get main tray"))?;
|
||||
match tray_event {
|
||||
TrayAction::TrayMenue => tray.set_show_menu_on_left_click(true)?,
|
||||
TrayAction::TrayMenu => tray.set_show_menu_on_left_click(true)?,
|
||||
_ => tray.set_show_menu_on_left_click(false)?,
|
||||
}
|
||||
Ok(())
|
||||
@ -418,6 +418,9 @@ impl Tray {
|
||||
let tray_action = TrayAction::from(tray_event.as_str());
|
||||
|
||||
tray.on_tray_icon_event(move |_app_handle, event| {
|
||||
if matches!(tray_action, TrayAction::Unknown) {
|
||||
return;
|
||||
}
|
||||
if let TrayIconEvent::Click {
|
||||
button: MouseButton::Left,
|
||||
button_state: MouseButtonState::Down,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user