improv(segmented_button): dnd state handling

This commit is contained in:
Ashley Wulber 2026-01-22 10:21:05 -05:00
parent d71c42102d
commit afde9c898f
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -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 {