Start on view-level dispatch approach for keyboard events
This commit is contained in:
parent
6e53deb1b2
commit
6e363e464c
22 changed files with 191 additions and 53 deletions
|
@ -36,7 +36,7 @@ impl View for ContactFinder {
|
|||
ChildView::new(self.picker.clone(), cx).boxed()
|
||||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
|
|
|
@ -1121,13 +1121,13 @@ impl View for ContactList {
|
|||
.boxed()
|
||||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
fn focus_in(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if !self.filter_editor.is_focused(cx) {
|
||||
cx.focus(&self.filter_editor);
|
||||
}
|
||||
}
|
||||
|
||||
fn on_focus_out(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
fn focus_out(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if !self.filter_editor.is_focused(cx) {
|
||||
cx.emit(Event::Dismissed);
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ impl View for ContactsPopover {
|
|||
.boxed()
|
||||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
fn focus_in(&mut self, _: gpui::AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
match &self.child {
|
||||
Child::ContactList(child) => cx.focus(child),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue