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:
oomeow
2026-08-20 16:09:16 +00:00
committed by GitHub
parent 332097bc9f
commit e71cf0ec68
6 changed files with 97 additions and 40 deletions
+25 -6
View File
@@ -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)),
}
}