From d79faab7899ebf1c9779415827ff7b629db87589 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:03:31 +0100 Subject: [PATCH] fix(widget): impl Catalog for qr_code --- src/theme/style/iced.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index 530df55f..f51e2650 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -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) + } +}