From 602565f98f3a22fa1c39e054c6a88b3c31a36599 Mon Sep 17 00:00:00 2001 From: pml68 Date: Thu, 26 Jun 2025 11:41:52 +0200 Subject: feat: initial commit --- src/qr_code.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/qr_code.rs (limited to 'src/qr_code.rs') diff --git a/src/qr_code.rs b/src/qr_code.rs new file mode 100644 index 0000000..f603440 --- /dev/null +++ b/src/qr_code.rs @@ -0,0 +1,24 @@ +use iced_widget::qr_code::{Catalog, Style, StyleFn}; + +use super::Theme; + +impl Catalog for Theme { + type Class<'a> = StyleFn<'a, Self>; + + fn default<'a>() -> Self::Class<'a> { + Box::new(default) + } + + fn style(&self, class: &Self::Class<'_>) -> Style { + class(self) + } +} + +pub fn default(theme: &Theme) -> Style { + let surface = theme.colors().surface; + + Style { + cell: surface.on_surface, + background: surface.color, + } +} -- cgit v1.2.3