summaryrefslogtreecommitdiff
path: root/crates/iced_drop/src/lib.rs
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-06-13 00:26:44 +0200
committerpml68 <contact@pml68.dev>2025-06-13 00:26:44 +0200
commita0501112cf3d74b9c79f7a985283ca2f41f5a7d3 (patch)
tree581042549e95602ec495317b260a4c45d965f352 /crates/iced_drop/src/lib.rs
parentchore: update deps (diff)
downloadiced-builder-a0501112cf3d74b9c79f7a985283ca2f41f5a7d3.tar.gz
chore: extract `iced_drop` into separate repo (`pml68/iced_drop`)
Diffstat (limited to 'crates/iced_drop/src/lib.rs')
-rw-r--r--crates/iced_drop/src/lib.rs55
1 files changed, 0 insertions, 55 deletions
diff --git a/crates/iced_drop/src/lib.rs b/crates/iced_drop/src/lib.rs
deleted file mode 100644
index c1e1b03..0000000
--- a/crates/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<Element<'a, Message, Theme, Renderer>>,
-) -> Droppable<'a, Message, Theme, Renderer>
-where
- Message: Clone,
- Renderer: renderer::Renderer,
-{
- Droppable::new(content)
-}
-
-pub fn zones_on_point<T, MF>(
- msg: MF,
- point: Point,
- options: Option<Vec<Id>>,
- depth: Option<usize>,
-) -> Task<T>
-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<Message, MF, F>(
- msg: MF,
- filter: F,
- options: Option<Vec<Id>>,
- depth: Option<usize>,
-) -> Task<Message>
-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))
-}