Rework presenter dispatch_event to allow isolated propogation of individual MouseRegionEvent types Co-Authored-By: mikayla@zed.dev

This commit is contained in:
K Simmons
2022-08-22 16:16:39 -07:00
parent 0d6125889f
commit 3fb4e6356c
6 changed files with 303 additions and 321 deletions
@@ -6,9 +6,8 @@ use crate::{
},
platform::CursorStyle,
scene::{
ClickRegionEvent, CursorRegion, DownOutRegionEvent, DownRegionEvent, DragOverRegionEvent,
DragRegionEvent, HandlerSet, HoverRegionEvent, MoveRegionEvent, UpOutRegionEvent,
UpRegionEvent,
ClickRegionEvent, CursorRegion, DownOutRegionEvent, DownRegionEvent, DragRegionEvent,
HandlerSet, HoverRegionEvent, MoveRegionEvent, UpOutRegionEvent, UpRegionEvent,
},
DebugContext, Element, ElementBox, Event, EventContext, LayoutContext, MeasurementContext,
MouseButton, MouseRegion, MouseState, PaintContext, RenderContext, SizeConstraint, View,
@@ -107,15 +106,6 @@ impl MouseEventHandler {
self
}
pub fn on_drag_over(
mut self,
button: MouseButton,
handler: impl Fn(DragOverRegionEvent, &mut EventContext) + 'static,
) -> Self {
self.handlers = self.handlers.on_drag_over(button, handler);
self
}
pub fn on_hover(
mut self,
handler: impl Fn(HoverRegionEvent, &mut EventContext) + 'static,