diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index b111848..b284e4e 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -1406,28 +1406,6 @@ impl text_input::Catalog for Theme { } } -// TODO card -// impl crate::widget::card::style::StyleSheet for Theme { -// fn default(&self) -> crate::widget::card::style::Style { -// let cosmic = self.cosmic(); - -// match self.layer { -// cosmic_theme::Layer::Background => crate::widget::card::style::Style { -// card_1: Background::Color(cosmic.background.component.hover.into()), -// card_2: Background::Color(cosmic.background.component.pressed.into()), -// }, -// cosmic_theme::Layer::Primary => crate::widget::card::style::Style { -// card_1: Background::Color(cosmic.primary.component.hover.into()), -// card_2: Background::Color(cosmic.primary.component.pressed.into()), -// }, -// cosmic_theme::Layer::Secondary => crate::widget::card::style::Style { -// card_1: Background::Color(cosmic.secondary.component.hover.into()), -// card_2: Background::Color(cosmic.secondary.component.pressed.into()), -// }, -// } -// } -// } - #[derive(Default)] pub enum TextEditor<'a> { #[default] diff --git a/src/widget/card/style.rs b/src/widget/card/style.rs index d73ef8f..0e63e84 100644 --- a/src/widget/card/style.rs +++ b/src/widget/card/style.rs @@ -24,3 +24,24 @@ pub trait Catalog { /// The default [`Appearance`] of the cards. fn default(&self) -> Style; } + +impl crate::widget::card::style::Catalog for crate::Theme { + fn default(&self) -> crate::widget::card::style::Style { + let cosmic = self.cosmic(); + + match self.layer { + cosmic_theme::Layer::Background => crate::widget::card::style::Style { + card_1: Background::Color(cosmic.background.component.hover.into()), + card_2: Background::Color(cosmic.background.component.pressed.into()), + }, + cosmic_theme::Layer::Primary => crate::widget::card::style::Style { + card_1: Background::Color(cosmic.primary.component.hover.into()), + card_2: Background::Color(cosmic.primary.component.pressed.into()), + }, + cosmic_theme::Layer::Secondary => crate::widget::card::style::Style { + card_1: Background::Color(cosmic.secondary.component.hover.into()), + card_2: Background::Color(cosmic.secondary.component.pressed.into()), + }, + } + } +}