summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-04-17 00:29:42 +0200
committerpml68 <contact@pml68.dev>2025-04-17 00:29:42 +0200
commit70f7cd31eb5055f80664c574e46003b202b2206f (patch)
tree2589b230be76d73bf562415508d98a5b1fa0c9f5 /crates
parentfeat(material_theme): implement `markdown::Catalog` (under feature flag) (diff)
downloadiced-builder-70f7cd31eb5055f80664c574e46003b202b2206f.tar.gz
feat(material_theme): implement `svg::Catalog` (under feature flag)
Diffstat (limited to 'crates')
-rw-r--r--crates/material_theme/Cargo.toml2
-rw-r--r--crates/material_theme/src/lib.rs2
-rw-r--r--crates/material_theme/src/svg.rs15
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)
+ }
+}