diff options
| author | pml68 <contact@pml68.dev> | 2025-07-31 13:40:49 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-07-31 13:40:49 +0200 |
| commit | 4c9fb58fd20230eb9c604a7ca179485405023a67 (patch) | |
| tree | a903fbd25e0dc9e549195a91d40ea5300bb4665f | |
| parent | feat: make `button::styled` public (diff) | |
| download | iced_material-4c9fb58fd20230eb9c604a7ca179485405023a67.tar.gz | |
feat: impl `table::Catalog` for `Theme`
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | src/table.rs | 25 |
2 files changed, 26 insertions, 0 deletions
@@ -25,6 +25,7 @@ pub mod scrollable; pub mod slider; #[cfg(feature = "svg")] pub mod svg; +pub mod table; pub mod text; pub mod text_editor; pub mod text_input; diff --git a/src/table.rs b/src/table.rs new file mode 100644 index 0000000..c5c6e5d --- /dev/null +++ b/src/table.rs @@ -0,0 +1,25 @@ +use iced_widget::core::Background; +use iced_widget::table::{Catalog, Style, StyleFn}; + +use super::Theme; + +impl Catalog for Theme { + type Class<'a> = StyleFn<'a, Self>; + + fn default<'a>() -> Self::Class<'a> { + Box::new(default) + } + + fn style(&self, class: &Self::Class<'_>) -> Style { + class(self) + } +} + +pub fn default(theme: &Theme) -> Style { + let separator = theme.colors().outline.variant; + + Style { + separator_x: Background::Color(separator), + separator_y: Background::Color(separator), + } +} |
