mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-01 03:42:07 +08:00
feat: watch linux theme changed (#7781)
* feat: add Linux theme change notifications and update dark-light dependency * fix: remove unused tauri Emitter import * update changelog * fix: clippy * fix: pnpm format
This commit is contained in:
@@ -16,13 +16,30 @@ pub enum FrontendEvent<'a> {
|
||||
RefreshVerge,
|
||||
RefreshProfiles,
|
||||
RefreshProxyConfig,
|
||||
NoticeMessage { status: &'a str, message: String },
|
||||
ProfileChanged { current_profile_id: &'a String },
|
||||
TimerUpdated { profile_index: &'a String },
|
||||
ProfileUpdateStarted { uid: &'a String },
|
||||
ProfileUpdateCompleted { uid: &'a String },
|
||||
RunStateChanged { state: serde_json::Value },
|
||||
NoticeMessage {
|
||||
status: &'a str,
|
||||
message: String,
|
||||
},
|
||||
ProfileChanged {
|
||||
current_profile_id: &'a String,
|
||||
},
|
||||
TimerUpdated {
|
||||
profile_index: &'a String,
|
||||
},
|
||||
ProfileUpdateStarted {
|
||||
uid: &'a String,
|
||||
},
|
||||
ProfileUpdateCompleted {
|
||||
uid: &'a String,
|
||||
},
|
||||
RunStateChanged {
|
||||
state: serde_json::Value,
|
||||
},
|
||||
PendingFailuresChanged,
|
||||
#[cfg(target_os = "linux")]
|
||||
ThemeChanged {
|
||||
theme: tauri::Theme,
|
||||
},
|
||||
}
|
||||
|
||||
/// Operation associated with a pending failure.
|
||||
@@ -279,6 +296,8 @@ impl NotificationSystem {
|
||||
FrontendEvent::ProfileUpdateCompleted { uid } => ("profile-update-completed", Ok(json!({ "uid": uid }))),
|
||||
FrontendEvent::RunStateChanged { state } => ("verge://run-state-changed", Ok(state)),
|
||||
FrontendEvent::PendingFailuresChanged => ("verge://pending-failures-changed", Ok(serde_json::Value::Null)),
|
||||
#[cfg(target_os = "linux")]
|
||||
FrontendEvent::ThemeChanged { theme } => ("tauri://theme-changed", serde_json::to_value(theme)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user