Merge branch 'gpui2' of github.com:zed-industries/zed into gpui2
This commit is contained in:
@@ -296,6 +296,7 @@ where
|
||||
cx: &mut ViewContext<V>,
|
||||
) {
|
||||
let click_listeners = mem::take(&mut self.listeners.mouse_click);
|
||||
|
||||
let mouse_down = pending_click.lock().clone();
|
||||
if let Some(mouse_down) = mouse_down {
|
||||
cx.on_mouse_event(move |state, event: &MouseUpEvent, phase, cx| {
|
||||
@@ -319,6 +320,15 @@ where
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(focus_handle) = self.focusability.focus_handle() {
|
||||
let focus_handle = focus_handle.clone();
|
||||
cx.on_mouse_event(move |_, event: &MouseDownEvent, phase, cx| {
|
||||
if phase == DispatchPhase::Bubble && bounds.contains_point(&event.position) {
|
||||
cx.focus(&focus_handle);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
for listener in mem::take(&mut self.listeners.mouse_down) {
|
||||
cx.on_mouse_event(move |state, event: &MouseDownEvent, phase, cx| {
|
||||
listener(state, event, &bounds, phase, cx);
|
||||
|
||||
Reference in New Issue
Block a user