Checkpoint

This commit is contained in:
Nathan Sobo 2023-10-23 14:15:12 +02:00
parent da8919002f
commit 96f2c4a9de
8 changed files with 170 additions and 57 deletions

View file

@ -1,5 +1,5 @@
use crate::{
px, size, Action, AnyBox, AnyView, AppContext, AsyncWindowContext, AvailableSpace,
px, size, Action, AnyBox, AnyDrag, AnyView, AppContext, AsyncWindowContext, AvailableSpace,
BorrowAppContext, Bounds, BoxShadow, Context, Corners, DevicePixels, DispatchContext,
DisplayId, Edges, Effect, Element, EntityId, EventEmitter, FocusEvent, FontId, GlobalElementId,
GlyphId, Handle, Hsla, ImageData, InputEvent, IsZero, KeyListener, KeyMatch, KeyMatcher,
@ -1605,6 +1605,14 @@ impl<'a, 'w, V: Send + Sync + 'static> ViewContext<'a, 'w, V> {
})
});
}
pub(crate) fn start_drag(&mut self, drag: AnyDrag) {
self.app.active_drag = Some(drag);
}
pub(crate) fn end_drag(&mut self) {
self.app.active_drag = None;
}
}
impl<'a, 'w, V: EventEmitter + Send + Sync + 'static> ViewContext<'a, 'w, V> {