mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat(hotkey): macos support CMD+W to close window as default
This commit is contained in:
@@ -148,6 +148,8 @@ impl Hotkey {
|
||||
"toggle_system_proxy" => || feat::toggle_system_proxy(),
|
||||
"toggle_tun_mode" => || feat::toggle_tun_mode(None),
|
||||
"quit" => || feat::quit(Some(0)),
|
||||
#[cfg(target_os = "macos")]
|
||||
"hide" => || feat::hide(),
|
||||
|
||||
_ => {
|
||||
println!("Invalid function: {}", func);
|
||||
@@ -181,7 +183,7 @@ impl Hotkey {
|
||||
.latest()
|
||||
.enable_global_hotkey
|
||||
.unwrap_or(true);
|
||||
|
||||
|
||||
if is_enable_global_hotkey {
|
||||
f();
|
||||
} else if let Some(window) = app_handle.get_webview_window("main") {
|
||||
|
||||
Reference in New Issue
Block a user