From b17edaf591c173495d1097f20684feb20d7db065 Mon Sep 17 00:00:00 2001 From: pml68 Date: Thu, 17 Apr 2025 00:28:53 +0200 Subject: feat(material_theme): implement `markdown::Catalog` (under feature flag) --- crates/material_theme/Cargo.toml | 6 ++++-- crates/material_theme/src/lib.rs | 2 ++ crates/material_theme/src/markdown.rs | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 crates/material_theme/src/markdown.rs diff --git a/crates/material_theme/Cargo.toml b/crates/material_theme/Cargo.toml index 58c5e0c..0cfa571 100644 --- a/crates/material_theme/Cargo.toml +++ b/crates/material_theme/Cargo.toml @@ -13,10 +13,12 @@ rust-version = "1.85" [features] default = [] -# Provides support for animating with `iced_anim` +# Provides support for animating with `iced_anim`. animate = ["dep:iced_anim"] -# Provides support for `iced_dialog` +# Provides support for `iced_dialog`. dialog = ["dep:iced_dialog"] +# Provides support for the markdown widget. +markdown = ["iced_widget/markdown"] [dependencies] iced_widget = "0.14.0-dev" diff --git a/crates/material_theme/src/lib.rs b/crates/material_theme/src/lib.rs index 2440538..e7ff343 100644 --- a/crates/material_theme/src/lib.rs +++ b/crates/material_theme/src/lib.rs @@ -9,6 +9,8 @@ pub mod checkbox; pub mod container; #[cfg(feature = "dialog")] pub mod dialog; +#[cfg(feature = "markdown")] +pub mod markdown; pub mod menu; pub mod pick_list; pub mod scrollable; diff --git a/crates/material_theme/src/markdown.rs b/crates/material_theme/src/markdown.rs new file mode 100644 index 0000000..bc14ffe --- /dev/null +++ b/crates/material_theme/src/markdown.rs @@ -0,0 +1,10 @@ +use iced_widget::markdown::Catalog; + +use super::{Theme, container}; + +impl Catalog for Theme { + fn code_block<'a>() -> ::Class<'a> + { + Box::new(container::surface_container_highest) + } +} -- cgit v1.2.3