Make close sidebar button work regardless of focus state (#52260)
Like https://github.com/zed-industries/zed/pull/52045, but for the *close* button. Release Notes: - N/A
This commit is contained in:
1 parent
78df135d15
commit
0b9aeaf663
2 files changed
+6
-2
No files matched your search
@@ -2916,7 +2916,11 @@ impl Sidebar {
|
||||
.into_any_element()
|
||||
}))
|
||||
.on_click(|_, window, cx| {
|
||||
window.dispatch_action(ToggleWorkspaceSidebar.boxed_clone(), cx);
|
||||
if let Some(multi_workspace) = window.root::<MultiWorkspace>().flatten() {
|
||||
multi_workspace.update(cx, |multi_workspace, cx| {
|
||||
multi_workspace.close_sidebar(window, cx);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ impl MultiWorkspace {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn close_sidebar(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
pub fn close_sidebar(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
self.sidebar_open = false;
|
||||
let has_notifications = self.sidebar_has_notifications(cx);
|
||||
let show_toggle = self.multi_workspace_enabled(cx);
|
||||
|
||||
Reference in new issue
Block a user