summaryrefslogtreecommitdiff
path: root/crates/material_theme/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/material_theme/src')
-rw-r--r--crates/material_theme/src/lib.rs2
-rw-r--r--crates/material_theme/src/svg.rs15
2 files changed, 17 insertions, 0 deletions
diff --git a/crates/material_theme/src/lib.rs b/crates/material_theme/src/lib.rs
index e7ff343..a41dfd5 100644
--- a/crates/material_theme/src/lib.rs
+++ b/crates/material_theme/src/lib.rs
@@ -14,6 +14,8 @@ pub mod markdown;
pub mod menu;
pub mod pick_list;
pub mod scrollable;
+#[cfg(feature = "svg")]
+pub mod svg;
pub mod text;
pub mod text_input;
pub mod utils;
diff --git a/crates/material_theme/src/svg.rs b/crates/material_theme/src/svg.rs
new file mode 100644
index 0000000..885d743
--- /dev/null
+++ b/crates/material_theme/src/svg.rs
@@ -0,0 +1,15 @@
+use iced_widget::svg::{Catalog, Status, Style, StyleFn};
+
+use super::Theme;
+
+impl Catalog for Theme {
+ type Class<'a> = StyleFn<'a, Self>;
+
+ fn default<'a>() -> Self::Class<'a> {
+ Box::new(|_theme, _status| Style::default())
+ }
+
+ fn style(&self, class: &Self::Class<'_>, status: Status) -> Style {
+ class(self, status)
+ }
+}