diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2025-10-20 14:23:22 +0200 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-10-20 14:24:33 +0200 |
| commit | d3437d1b64cc632ab7358264825db683d15d1c69 (patch) | |
| tree | 51b38588bf9b26f3664d89a575cf7e74696a1405 /src/selection.rs | |
| parent | chore: update mailing list address (diff) | |
| download | iced_material-d3437d1b64cc632ab7358264825db683d15d1c69.tar.gz | |
feat: add support for `pml68/iced_selection`
Diffstat (limited to '')
| -rw-r--r-- | src/selection.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/selection.rs b/src/selection.rs new file mode 100644 index 0000000..cbf8bd4 --- /dev/null +++ b/src/selection.rs @@ -0,0 +1,22 @@ +use iced_selection::text::{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 { + Style { + color: None, + selection: theme.colors().primary.primary_container, + } +} |
