From d3437d1b64cc632ab7358264825db683d15d1c69 Mon Sep 17 00:00:00 2001 From: Polesznyák Márk Date: Mon, 20 Oct 2025 14:23:22 +0200 Subject: feat: add support for `pml68/iced_selection` --- src/selection.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/selection.rs (limited to 'src/selection.rs') 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, + } +} -- cgit v1.2.3