fix: impl Catalog for qr_code

This commit is contained in:
wiiznokes 2024-11-17 00:15:15 +01:00
parent a355a049d9
commit fed91dd18f

View file

@ -1486,3 +1486,19 @@ impl iced_widget::markdown::Catalog for Theme {
})
}
}
#[cfg(feature = "qr_code")]
impl iced_widget::qr_code::Catalog for Theme {
type Class<'a> = iced_widget::qr_code::StyleFn<'a, Self>;
fn default<'a>() -> Self::Class<'a> {
Box::new(|_theme| iced_widget::qr_code::Style {
cell: Color::BLACK,
background: Color::WHITE,
})
}
fn style(&self, class: &Self::Class<'_>) -> iced_widget::qr_code::Style {
class(self)
}
}