Dismiss context menu when (right-)mousing down outside of it
This commit is contained in:
parent
fb26f8195b
commit
e7ab61d125
2 changed files with 62 additions and 40 deletions
|
@ -88,6 +88,22 @@ impl MouseEventHandler {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn on_mouse_down_out(
|
||||
mut self,
|
||||
handler: impl Fn(Vector2F, &mut EventContext) + 'static,
|
||||
) -> Self {
|
||||
self.mouse_down_out = Some(Rc::new(handler));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_right_mouse_down_out(
|
||||
mut self,
|
||||
handler: impl Fn(Vector2F, &mut EventContext) + 'static,
|
||||
) -> Self {
|
||||
self.right_mouse_down_out = Some(Rc::new(handler));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn on_drag(mut self, handler: impl Fn(Vector2F, &mut EventContext) + 'static) -> Self {
|
||||
self.drag = Some(Rc::new(handler));
|
||||
self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue