mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-13 14:22:08 +08:00
feat: show detailed results in hotkey notifications (#6639)
* feat: show detailed results in hotkey notifications * fix: Japanese locale appears to have a truncated translation key label * fix: variable naming * Update documentation to English * Remove unnecessary mut * feat: enhance system proxy notifications with toggle state * chore: update changelog to include new shortcut notification feature * fix: remove unnecessary quotes from system proxy toggle messages in localization files * fix: tun mode toggled hotkey notifications * fix: correct toggle_tun_mode logic to handle current state and errors --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
@@ -9,8 +9,8 @@ pub enum NotificationEvent<'a> {
|
||||
ClashModeChanged {
|
||||
mode: &'a str,
|
||||
},
|
||||
SystemProxyToggled,
|
||||
TunModeToggled,
|
||||
SystemProxyToggled(bool),
|
||||
TunModeToggled(bool),
|
||||
LightweightModeEntered,
|
||||
ProfilesReactivated,
|
||||
AppQuit,
|
||||
@@ -37,14 +37,25 @@ pub async fn notify_event<'a>(event: NotificationEvent<'a>) {
|
||||
.into();
|
||||
notify(title, body);
|
||||
}
|
||||
NotificationEvent::SystemProxyToggled => {
|
||||
NotificationEvent::SystemProxyToggled(enabled) => {
|
||||
let title = clash_verge_i18n::t!("notifications.systemProxyToggled.title");
|
||||
let body = clash_verge_i18n::t!("notifications.systemProxyToggled.body");
|
||||
let key = if enabled {
|
||||
"notifications.systemProxyToggled.on"
|
||||
} else {
|
||||
"notifications.systemProxyToggled.off"
|
||||
};
|
||||
|
||||
let body = clash_verge_i18n::t!(key);
|
||||
notify(title, body);
|
||||
}
|
||||
NotificationEvent::TunModeToggled => {
|
||||
NotificationEvent::TunModeToggled(enabled) => {
|
||||
let title = clash_verge_i18n::t!("notifications.tunModeToggled.title");
|
||||
let body = clash_verge_i18n::t!("notifications.tunModeToggled.body");
|
||||
let key = if enabled {
|
||||
"notifications.tunModeToggled.on"
|
||||
} else {
|
||||
"notifications.tunModeToggled.off"
|
||||
};
|
||||
let body = clash_verge_i18n::t!(key);
|
||||
notify(title, body);
|
||||
}
|
||||
NotificationEvent::LightweightModeEntered => {
|
||||
|
||||
Reference in New Issue
Block a user