summaryrefslogtreecommitdiff
path: root/crates/iced_drop/src/widget/droppable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/iced_drop/src/widget/droppable.rs')
-rw-r--r--crates/iced_drop/src/widget/droppable.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/crates/iced_drop/src/widget/droppable.rs b/crates/iced_drop/src/widget/droppable.rs
index 063aef8..0e93bd0 100644
--- a/crates/iced_drop/src/widget/droppable.rs
+++ b/crates/iced_drop/src/widget/droppable.rs
@@ -462,19 +462,17 @@ where
let state = tree.state.downcast_ref::<State>();
- if self.on_drop.is_none() && cursor.is_over(layout.bounds()) {
- return mouse::Interaction::NotAllowed;
- }
-
- if let Action::Drag(_, _) = state.action {
- return mouse::Interaction::Grabbing;
- }
-
if cursor.is_over(layout.bounds()) {
- return mouse::Interaction::Pointer;
+ if self.on_drop.is_none() {
+ mouse::Interaction::NotAllowed
+ } else if let Action::Drag(_, _) = state.action {
+ mouse::Interaction::Grabbing
+ } else {
+ mouse::Interaction::Pointer
+ }
+ } else {
+ mouse::Interaction::default()
}
-
- mouse::Interaction::default()
}
}