From 495985f449e46b24e6b734d3aa9e135a779a8b77 Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 13 Apr 2025 03:40:38 +0200 Subject: refactor: move `material_theme` and `iced_drop` into separate crates dir --- iced_drop/src/lib.rs | 55 ---------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 iced_drop/src/lib.rs (limited to 'iced_drop/src/lib.rs') diff --git a/iced_drop/src/lib.rs b/iced_drop/src/lib.rs deleted file mode 100644 index c1e1b03..0000000 --- a/iced_drop/src/lib.rs +++ /dev/null @@ -1,55 +0,0 @@ -pub mod widget; - -use iced::advanced::graphics::futures::MaybeSend; -use iced::advanced::renderer; -use iced::advanced::widget::{operate, Id}; -use iced::task::Task; -use iced::{Element, Point, Rectangle}; -use widget::droppable::*; -use widget::operation::drop; - -pub fn droppable<'a, Message, Theme, Renderer>( - content: impl Into>, -) -> Droppable<'a, Message, Theme, Renderer> -where - Message: Clone, - Renderer: renderer::Renderer, -{ - Droppable::new(content) -} - -pub fn zones_on_point( - msg: MF, - point: Point, - options: Option>, - depth: Option, -) -> Task -where - T: Send + 'static, - MF: Fn(Vec<(Id, Rectangle)>) -> T + MaybeSend + Sync + Clone + 'static, -{ - operate(drop::find_zones( - move |bounds| bounds.contains(point), - options, - depth, - )) - .map(move |id| msg(id)) -} - -pub fn find_zones( - msg: MF, - filter: F, - options: Option>, - depth: Option, -) -> Task -where - Message: Send + 'static, - MF: Fn(Vec<(Id, Rectangle)>) -> Message - + MaybeSend - + Sync - + Clone - + 'static, - F: Fn(&Rectangle) -> bool + Send + 'static, -{ - operate(drop::find_zones(filter, options, depth)).map(move |id| msg(id)) -} -- cgit v1.2.3