From fed91dd18f5ed934f75a0fe76a0862452383333f Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Sun, 17 Nov 2024 00:15:15 +0100 Subject: [PATCH] fix: 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 8a49ec09..d9014595 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -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) + } +}