Address picker issues
This commit is contained in:
parent
6f180ed822
commit
f5a6a112c8
9 changed files with 24 additions and 9 deletions
|
@ -134,9 +134,11 @@ impl View for CommandPalette {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PickerDelegate for CommandPalette {
|
||||
fn match_count(&self) -> usize {
|
||||
|
|
|
@ -54,9 +54,11 @@ impl View for FileFinder {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FileFinder {
|
||||
fn labels_for_match(&self, path_match: &PathMatch) -> (String, Vec<usize>, String, Vec<usize>) {
|
||||
|
|
|
@ -53,9 +53,11 @@ impl View for OutlineView {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl OutlineView {
|
||||
fn new(
|
||||
|
|
|
@ -119,9 +119,11 @@ impl<D: PickerDelegate> View for Picker<D> {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.query_editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: PickerDelegate> Picker<D> {
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
|
|
|
@ -52,9 +52,11 @@ impl View for ProjectSymbolsView {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ProjectSymbolsView {
|
||||
fn new(project: ModelHandle<Project>, cx: &mut ViewContext<Self>) -> Self {
|
||||
|
|
|
@ -81,8 +81,10 @@ impl View for BufferSearchBar {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.query_editor);
|
||||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let theme = cx.global::<Settings>().theme.clone();
|
||||
|
|
|
@ -153,8 +153,10 @@ impl View for TerminalView {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(self.content.handle());
|
||||
}
|
||||
}
|
||||
|
||||
fn keymap_context(&self, _: &gpui::AppContext) -> gpui::keymap::Context {
|
||||
let mut context = Self::default_keymap_context();
|
||||
|
|
|
@ -250,6 +250,8 @@ impl View for ThemeSelector {
|
|||
}
|
||||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
cx.focus(&self.picker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2476,7 +2476,6 @@ impl View for Workspace {
|
|||
|
||||
fn on_focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
|
||||
if cx.is_self_focused() {
|
||||
println!("Active Pane Focused");
|
||||
cx.focus(&self.active_pane);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue