improv(segmented_button): dnd state handling
This commit is contained in:
parent
d71c42102d
commit
afde9c898f
1 changed files with 7 additions and 4 deletions
|
|
@ -968,17 +968,20 @@ where
|
||||||
} else {
|
} else {
|
||||||
mime_types.clone()
|
mime_types.clone()
|
||||||
};
|
};
|
||||||
state.offer_mimes = mimes.clone();
|
state.offer_mimes.clone_from(&mimes);
|
||||||
|
|
||||||
_ = state
|
_ = state
|
||||||
.dnd_state
|
.dnd_state
|
||||||
.on_enter::<Message>(*x, *y, mimes, on_dnd_enter, entity);
|
.on_enter::<Message>(*x, *y, mimes, on_dnd_enter, entity);
|
||||||
}
|
}
|
||||||
DndEvent::Offer(id, OfferEvent::LeaveDestination) if Some(my_id) != *id => {}
|
DndEvent::Offer(id, OfferEvent::LeaveDestination) if Some(my_id) != *id => {}
|
||||||
DndEvent::Offer(id, OfferEvent::Leave | OfferEvent::LeaveDestination)
|
DndEvent::Offer(id, leave)
|
||||||
if Some(my_id) == *id =>
|
if matches!(leave, OfferEvent::Leave | OfferEvent::LeaveDestination)
|
||||||
|
&& Some(my_id) == *id =>
|
||||||
{
|
{
|
||||||
|
if matches!(leave, OfferEvent::Leave) {
|
||||||
state.dragging_tab = None;
|
state.dragging_tab = None;
|
||||||
|
}
|
||||||
state.drop_hint = None;
|
state.drop_hint = None;
|
||||||
self.emit_drop_hint(shell, state.drop_hint);
|
self.emit_drop_hint(shell, state.drop_hint);
|
||||||
if let Some(Some(entity)) = entity {
|
if let Some(Some(entity)) = entity {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue