mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:23:44 +08:00
fix: update lightweight mode implementation and fix MacOS dock icon visibility
This commit is contained in:
parent
827ab4b1c5
commit
53023fa189
@ -20,6 +20,8 @@
|
||||
- 修复 Linux 无法与 Mihomo 核心 和 ClashVergeRev 服务通信
|
||||
3. **界面**
|
||||
- 修复 连接详情卡没有跟随主题色
|
||||
4. **轻量模式**
|
||||
- 修复 MacOS 轻量模式下 Dock 栏图标无法隐藏。
|
||||
|
||||
新增了:
|
||||
1. **首页**
|
||||
|
@ -1,4 +1,7 @@
|
||||
use crate::{config::Config, core::handle, feat, log_err, utils::resolve};
|
||||
use crate::{
|
||||
config::Config, core::handle, feat, log_err, module::lightweight::entry_lightweight_mode,
|
||||
utils::resolve,
|
||||
};
|
||||
use anyhow::{bail, Result};
|
||||
use once_cell::sync::OnceCell;
|
||||
use parking_lot::Mutex;
|
||||
@ -147,7 +150,7 @@ impl Hotkey {
|
||||
"clash_mode_direct" => || feat::change_clash_mode("direct".into()),
|
||||
"toggle_system_proxy" => || feat::toggle_system_proxy(),
|
||||
"toggle_tun_mode" => || feat::toggle_tun_mode(None),
|
||||
"entry_lightweight_mode" => || feat::lightweight_mode(),
|
||||
"entry_lightweight_mode" => || entry_lightweight_mode(),
|
||||
"quit" => || feat::quit(Some(0)),
|
||||
#[cfg(target_os = "macos")]
|
||||
"hide" => || feat::hide(),
|
||||
|
@ -6,7 +6,7 @@ use crate::{
|
||||
cmd,
|
||||
config::Config,
|
||||
feat,
|
||||
module::mihomo::Rate,
|
||||
module::{lightweight::entry_lightweight_mode, mihomo::Rate},
|
||||
resolve,
|
||||
utils::{dirs, i18n::t, resolve::VERSION},
|
||||
};
|
||||
@ -663,7 +663,7 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
|
||||
"open_logs_dir" => crate::log_err!(cmd::open_logs_dir()),
|
||||
"restart_clash" => feat::restart_clash_core(),
|
||||
"restart_app" => feat::restart_app(),
|
||||
"entry_lightweight_mode" => feat::lightweight_mode(),
|
||||
"entry_lightweight_mode" => entry_lightweight_mode(),
|
||||
"quit" => {
|
||||
println!("quit");
|
||||
feat::quit(Some(0));
|
||||
|
@ -1,6 +1 @@
|
||||
use crate::module::lightweight::entry_lightweight_mode;
|
||||
|
||||
pub fn lightweight_mode() {
|
||||
log::info!(target: "app","Lightweight mode enabled");
|
||||
entry_lightweight_mode();
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ mod window;
|
||||
pub use backup::*;
|
||||
pub use clash::*;
|
||||
pub use config::*;
|
||||
pub use lightweight::*;
|
||||
pub use profile::*;
|
||||
pub use proxy::*;
|
||||
pub use window::*;
|
||||
|
@ -5,7 +5,7 @@ use tauri::{Listener, Manager};
|
||||
use crate::{
|
||||
config::Config,
|
||||
core::{handle, timer::Timer},
|
||||
log_err,
|
||||
log_err, AppHandleManager,
|
||||
};
|
||||
|
||||
const LIGHT_WEIGHT_TASK_UID: &str = "light_weight_task";
|
||||
@ -32,6 +32,7 @@ pub fn entry_lightweight_mode() {
|
||||
if let Some(webview) = window.get_webview_window("main") {
|
||||
let _ = webview.destroy();
|
||||
}
|
||||
AppHandleManager::global().set_activation_policy_accessory();
|
||||
println!("[lightweight_mode] 轻量模式已开启");
|
||||
log::info!(target: "app", "[lightweight_mode] 轻量模式已开启");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user