diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/material_theme/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/material_theme/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/material_theme/src/svg.rs | 15 |
3 files changed, 19 insertions, 0 deletions
diff --git a/crates/material_theme/Cargo.toml b/crates/material_theme/Cargo.toml index 0cfa571..ad825fd 100644 --- a/crates/material_theme/Cargo.toml +++ b/crates/material_theme/Cargo.toml @@ -19,6 +19,8 @@ animate = ["dep:iced_anim"] dialog = ["dep:iced_dialog"] # Provides support for the markdown widget. markdown = ["iced_widget/markdown"] +# Provides support for the SVG widget. +svg = ["iced_widget/svg"] [dependencies] iced_widget = "0.14.0-dev" 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) + } +} |
