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-ipc = { path = "../../crates/ferese-ipc" }
ferese-config = { path = "../../crates/ferese-config" }
ferese-theme = { path = "../../crates/ferese-theme" }
+6 -6
View File
@@ -26,7 +26,7 @@ struct Appearance {
impl Appearance {
fn load() -> Self {
let snapshot = ferese_theme::service::current();
let snapshot = ferese_theme_client::service::current();
Self::from_resolved(&snapshot.presented)
}
@@ -37,7 +37,7 @@ impl Appearance {
appearance: theme.appearance,
high_contrast: theme.accessibility.increase_contrast,
surface: Color {
a: ferese_theme::service::opacity(theme),
a: ferese_theme::material_opacity(theme),
..palette.sidebar
},
text: palette.text,
@@ -74,7 +74,7 @@ impl Appearance {
enum Message {
ThemeChanged(Box<ferese_ipc::theme::Snapshot>),
WindowOpened(cosmic::iced::window::Id),
MaterialAttached(Result<ferese_theme::material::ModalMaterial, String>),
MaterialAttached(Result<ferese_theme_client::material::ModalMaterial, String>),
Tick,
Input(String),
Submit,
@@ -91,7 +91,7 @@ impl std::fmt::Debug for Message {
struct Prompt {
core: Core,
material: Option<ferese_theme::material::ModalMaterial>,
material: Option<ferese_theme_client::material::ModalMaterial>,
appearance: Appearance,
incoming: Arc<Mutex<VecDeque<PromptEvent>>>,
request: AuthenticationRequest,
@@ -302,7 +302,7 @@ impl cosmic::Application for Prompt {
fn subscription(&self) -> Subscription<Message> {
Subscription::batch([
ferese_theme::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
ferese_theme_client::service::subscription().map(|snapshot| Message::ThemeChanged(Box::new(snapshot))),
cosmic::iced::time::every(Duration::from_millis(30)).map(|_| Message::Tick),
cosmic::iced::event::listen_with(|event, _, id| match event {
cosmic::iced::Event::Window(cosmic::iced::window::Event::Opened { .. }) => {
@@ -320,7 +320,7 @@ impl cosmic::Application for Prompt {
return cosmic::command::set_theme(self.appearance.theme());
}
Message::WindowOpened(id) => {
return cosmic::iced::window::run(id, ferese_theme::material::ModalMaterial::attach)
return cosmic::iced::window::run(id, ferese_theme_client::material::ModalMaterial::attach)
.map(|result| cosmic::Action::App(Message::MaterialAttached(result)));
}
Message::MaterialAttached(result) => {