fix(theme): typo and derive PartialEq for ThemeBuilder

This commit is contained in:
Ashley Wulber 2023-10-05 17:58:43 -04:00
parent 6543629f45
commit 3ee829f04f
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 13 additions and 11 deletions

View file

@ -459,7 +459,12 @@ where
/// Helper for building customized themes /// Helper for building customized themes
#[derive( #[derive(
Clone, Debug, Serialize, Deserialize, cosmic_config::cosmic_config_derive::CosmicConfigEntry, Clone,
Debug,
Serialize,
Deserialize,
cosmic_config::cosmic_config_derive::CosmicConfigEntry,
PartialEq,
)] )]
pub struct ThemeBuilder { pub struct ThemeBuilder {
/// override the palette for the builder /// override the palette for the builder
@ -528,7 +533,7 @@ impl ThemeBuilder {
pub fn dark_high_contrast() -> Self { pub fn dark_high_contrast() -> Self {
let palette: CosmicPalette<Srgba> = DARK_PALETTE.to_owned().into(); let palette: CosmicPalette<Srgba> = DARK_PALETTE.to_owned().into();
Self { Self {
palette: CosmicPalette::HighContrastLight(palette.inner()), palette: CosmicPalette::HighContrastDark(palette.inner()),
..Default::default() ..Default::default()
} }
} }

View file

@ -163,16 +163,13 @@ where
cosmic_theme::THEME_MODE_ID.into(), cosmic_theme::THEME_MODE_ID.into(),
cosmic_theme::ThemeMode::version(), cosmic_theme::ThemeMode::version(),
) )
.map(|(_, u)| { .map(|(_, u)| match u {
tracing::error!("{u:?}"); Ok(t) => Message::SystemThemeModeChange(t),
match u { Err((errors, t)) => {
Ok(t) => Message::SystemThemeModeChange(t), for e in errors {
Err((errors, t)) => { tracing::error!("{e}");
for e in errors {
tracing::error!("{e}");
}
Message::SystemThemeModeChange(t)
} }
Message::SystemThemeModeChange(t)
} }
}) })
.map(super::Message::Cosmic), .map(super::Message::Cosmic),