project_panel: Create items when the editor is dismissed via the mouse (#21045)
Closes #5036 Release Notes: - Created project panel items when the editor is dismissed via the mouse
This commit is contained in:
parent
72d8f2e595
commit
241b14eeaf
1 changed files with 7 additions and 0 deletions
|
@ -281,6 +281,7 @@ impl ProjectPanel {
|
||||||
let focus_handle = cx.focus_handle();
|
let focus_handle = cx.focus_handle();
|
||||||
cx.on_focus(&focus_handle, Self::focus_in).detach();
|
cx.on_focus(&focus_handle, Self::focus_in).detach();
|
||||||
cx.on_focus_out(&focus_handle, |this, _, cx| {
|
cx.on_focus_out(&focus_handle, |this, _, cx| {
|
||||||
|
this.focus_out(cx);
|
||||||
this.hide_scrollbar(cx);
|
this.hide_scrollbar(cx);
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
@ -595,6 +596,12 @@ impl ProjectPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn focus_out(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
|
if !self.focus_handle.is_focused(cx) {
|
||||||
|
self.confirm(&Confirm, cx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn deploy_context_menu(
|
fn deploy_context_menu(
|
||||||
&mut self,
|
&mut self,
|
||||||
position: Point<Pixels>,
|
position: Point<Pixels>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue