Separate theme rendering from client subscriptions and materials

This commit is contained in:
Samuel Onoja committed 2026-10-03 00:12:59 +01:00
1 parent ccf7497b6f
commit cc0bddbec1
32 files changed
+428 -143

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ license.workspace = true
rust-version.workspace = true
[dependencies]
ferese-theme-client = { path = "../../crates/ferese-theme-client" }
ferese-theme = { path = "../../crates/ferese-theme" }
ferese-config = { path = "../../crates/ferese-config" }
libcosmic = { workspace = true, features = ["wgpu", "a11y", "xdg-portal"] }
+2 -2
View File
@@ -214,7 +214,7 @@ impl cosmic::Application for App {
.into();
let error = initial.as_ref().err().cloned();
let current = initial.unwrap_or_else(|_| Snapshot::parse(String::new()).unwrap());
let resolved = ferese_theme::service::current();
let resolved = ferese_theme_client::service::current();
let font = ferese_theme::font(Some(&resolved.presented.tokens.typography.font_family));
let native_palette = visuals::Palette::from_resolved(&resolved.presented);
let mut app = Self {
@@ -815,7 +815,7 @@ impl cosmic::Application for App {
fn subscription(&self) -> cosmic::iced::Subscription<Message> {
cosmic::iced::Subscription::batch([
cosmic::iced::Subscription::run_with(self.path.clone(), |path| watch::changes(path)),
ferese_theme::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
ferese_theme_client::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
if self.page == Page::Displays {
cosmic::iced::time::every(std::time::Duration::from_secs(2)).map(|_| Message::RefreshDisplays)
} else {
+2 -2
View File
@@ -22,7 +22,7 @@ fn hex(c: Color) -> String {
}
pub fn native_theme(_snapshot: Option<&Snapshot>) -> cosmic::Theme {
Palette::from_resolved(&ferese_theme::service::current().presented).native_theme()
Palette::from_resolved(&ferese_theme_client::service::current().presented).native_theme()
}
pub fn icon(page: Page, tint: Color) -> svg_icon::Icon {
@@ -41,7 +41,7 @@ pub fn action_icon(path: &str, tint: Color) -> svg_icon::Icon {
}
#[cfg(test)]
pub use ferese_theme::PRESETS;
pub use ferese_config::presets::PRESETS;
pub fn split(snapshot: &Snapshot) -> bool {
snapshot