GPUI change proposals

This commit is contained in:
Mikayla Maki 2022-07-06 17:52:20 -07:00
parent 4d88088ca4
commit b2fa511acd
5 changed files with 24 additions and 9 deletions

View file

@ -24,7 +24,7 @@ pub struct MouseEventHandler {
right_click: Option<Rc<dyn Fn(Vector2F, usize, &mut EventContext)>>,
mouse_down_out: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
right_mouse_down_out: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
drag: Option<Rc<dyn Fn(Vector2F, &mut EventContext)>>,
drag: Option<Rc<dyn Fn(Vector2F, Vector2F, &mut EventContext)>>,
hover: Option<Rc<dyn Fn(Vector2F, bool, &mut EventContext)>>,
padding: Padding,
}
@ -106,7 +106,10 @@ impl MouseEventHandler {
self
}
pub fn on_drag(mut self, handler: impl Fn(Vector2F, &mut EventContext) + 'static) -> Self {
pub fn on_drag(
mut self,
handler: impl Fn(Vector2F, Vector2F, &mut EventContext) + 'static,
) -> Self {
self.drag = Some(Rc::new(handler));
self
}