fix(widget): impl Catalog for qr_code

This commit is contained in:
wiiznokes 2024-11-19 20:03:31 +01:00 committed by GitHub
parent a58c73334e
commit d79faab789
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1478,3 +1478,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)
}
}