Skip to content

Commit

Permalink
fix(widget): impl Catalog for qr_code
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes authored Nov 19, 2024
1 parent a58c733 commit d79faab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/theme/style/iced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit d79faab

Please sign in to comment.