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