Add in-window on-move-out mouse handler concept

This commit is contained in:
Julia
2023-01-19 12:34:13 -05:00
parent 5189dea3d5
commit ad1947fa50
5 changed files with 66 additions and 4 deletions
@@ -7,7 +7,7 @@ use crate::{
platform::CursorStyle,
scene::{
CursorRegion, HandlerSet, MouseClick, MouseDown, MouseDownOut, MouseDrag, MouseHover,
MouseMove, MouseScrollWheel, MouseUp, MouseUpOut,
MouseMove, MouseMoveOut, MouseScrollWheel, MouseUp, MouseUpOut,
},
DebugContext, Element, ElementBox, EventContext, LayoutContext, MeasurementContext,
MouseButton, MouseRegion, MouseState, PaintContext, RenderContext, SizeConstraint, View,
@@ -82,6 +82,14 @@ impl<Tag> MouseEventHandler<Tag> {
self
}
pub fn on_move_out(
mut self,
handler: impl Fn(MouseMoveOut, &mut EventContext) + 'static,
) -> Self {
self.handlers = self.handlers.on_move_out(handler);
self
}
pub fn on_down(
mut self,
button: MouseButton,