summaryrefslogtreecommitdiffstats
path: root/native/src/widget/pane_grid/draggable.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-03-10 19:25:57 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-03-14 17:44:25 +0700
commit6dd187ff0822230f084e43636b1aabeb1baf06f6 (patch)
tree27426980b2882025a3c812ba2401d3bf8f6dca8d /native/src/widget/pane_grid/draggable.rs
parent9f27969d14232355ad628431fb67aa07e42e768f (diff)
downloadiced-6dd187ff0822230f084e43636b1aabeb1baf06f6.tar.gz
iced-6dd187ff0822230f084e43636b1aabeb1baf06f6.tar.bz2
iced-6dd187ff0822230f084e43636b1aabeb1baf06f6.zip
Implement `pure` version of `PaneGrid` widget
Diffstat (limited to 'native/src/widget/pane_grid/draggable.rs')
-rw-r--r--native/src/widget/pane_grid/draggable.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/native/src/widget/pane_grid/draggable.rs b/native/src/widget/pane_grid/draggable.rs
new file mode 100644
index 00000000..6044871d
--- /dev/null
+++ b/native/src/widget/pane_grid/draggable.rs
@@ -0,0 +1,12 @@
+use crate::{Layout, Point};
+
+/// A pane that can be dragged.
+pub trait Draggable {
+ /// Returns whether the [`Draggable`] with the given [`Layout`] can be picked
+ /// at the provided cursor position.
+ fn can_be_dragged_at(
+ &self,
+ layout: Layout<'_>,
+ cursor_position: Point,
+ ) -> bool;
+}