Add key bindings to toggle the project panel
- Use `cmd-1` to open the project panel and toggle focus between it and the workspace center. - Use `cmd-shift-1` to open or close the project panel.
This commit is contained in:
@@ -2900,6 +2900,11 @@ impl AnyViewHandle {
|
||||
TypeId::of::<T>() == self.view_type
|
||||
}
|
||||
|
||||
pub fn is_focused(&self, cx: &AppContext) -> bool {
|
||||
cx.focused_view_id(self.window_id)
|
||||
.map_or(false, |focused_id| focused_id == self.view_id)
|
||||
}
|
||||
|
||||
pub fn downcast<T: View>(self) -> Option<ViewHandle<T>> {
|
||||
if self.is::<T>() {
|
||||
let result = Some(ViewHandle {
|
||||
|
||||
Reference in New Issue
Block a user